You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Yu, Corwin" <co...@phasecap.com> on 2009/05/29 17:55:50 UTC

build question

This one is a definate newbie to ant question. I just installed Ant, and the latest SVN pull, and I'm getting this error: 
----- 

[javac] [421 units compiled] 
[javac] ---------- 
[javac] 1. ERROR in /opt/pdfbox/trunk/src/main/java/org/apache/pdfbox/ConvertColorspace.java (at line 1) 
[javac] /* 
[javac] ^ 
[javac] The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files 
[javac] ---------- 
[javac] 1 problem (1 error) 

BUILD FAILED 
/opt/pdfbox/trunk/build.xml:131: Compile failed; see the compiler error output for details. 
---- 

Any ideas? 

renaming a field and not able to set value to the saved PDF document ...

Posted by Venkatesh Prasad <ve...@trv.envestnet.com>.
I renamed fields in a PDF document "source.PDF" and saved the document as 'target.PDF". I was then not able to set values to the fields in the saved document 'target.PDF". I also observed reduction in the size of the saved PDF - source.PDF (3.34 MB) - target.PDF (911 KB).
 
Can anyone help? The code I used to rename the fields is given below:
 
     PDDocument pdfDocument = PDDocument.load(pdfSource);
     try
     {
      if (pdfDocument.isEncrypted())
      {
       pdfDocument.decrypt("");
      }
      PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog();
      PDAcroForm acroForm = docCatalog.getAcroForm();
      if (acroForm != null)
      {
       List pdfFields = acroForm.getFields();
       if (pdfFields != null)
       {
        PDField pdfField;
        for (int i = 0; i < pdfFields.size(); i++)
        {
         pdfField = (PDField) pdfFields.get(i);
         String fieldName = pdfField.getPartialName();
         if( fieldName.equalsIgnoreCase("Test1") ){
          String newFieldName = "Account@Name1";
          pdfField.setPartialName(newFieldName);
         }
        }
        pdfDocument.save(pdfOutput);
       } else {
        return "No Acro Form Fields found in PDF Document " + pdfSource + "!";
       }
      } else {
       return "PDF document " + pdfSource + " not able to access!";
      }
     } catch (Exception e) {
      return "PDF Document " + pdfSource + " is encrypted! Cannot process.";
     }
     pdfDocument.close();
 
Thanks & Regards
 
Venkatesh Prasad.B.K.
 

Re: build question

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi Corwin,

did you setup your java-environment correctly? It seems to be a problem 
with some missing java-classes from the JDK/JRE-jar.

Andreas Lehmkühler

Daniel Wilson schrieb:
> Not sure, Corwin. I have to think you have something set up wrong, but I
> don't know what!
> 
> I'm copying the development group as some of the other developers have a lot
> more Java experience than I.
> 
> Daniel Wilson
> 
> On Fri, May 29, 2009 at 11:55 AM, Yu, Corwin <co...@phasecap.com> wrote:
> 
>> This one is a definate newbie to ant question. I just installed Ant, and
>> the latest SVN pull, and I'm getting this error:
>> -----
>>
>> [javac] [421 units compiled]
>> [javac] ----------
>> [javac] 1. ERROR in
>> /opt/pdfbox/trunk/src/main/java/org/apache/pdfbox/ConvertColorspace.java (at
>> line 1)
>> [javac] /*
>> [javac] ^
>> [javac] The type java.lang.Object cannot be resolved. It is indirectly
>> referenced from required .class files
>> [javac] ----------
>> [javac] 1 problem (1 error)
>>
>> BUILD FAILED
>> /opt/pdfbox/trunk/build.xml:131: Compile failed; see the compiler error
>> output for details.
>> ----
>>
>> Any ideas?
>>
> 

Re: build question

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi Corwin,

did you setup your java-environment correctly? It seems to be a problem 
with some missing java-classes from the JDK/JRE-jar.

Andreas Lehmkühler

Daniel Wilson schrieb:
> Not sure, Corwin. I have to think you have something set up wrong, but I
> don't know what!
> 
> I'm copying the development group as some of the other developers have a lot
> more Java experience than I.
> 
> Daniel Wilson
> 
> On Fri, May 29, 2009 at 11:55 AM, Yu, Corwin <co...@phasecap.com> wrote:
> 
>> This one is a definate newbie to ant question. I just installed Ant, and
>> the latest SVN pull, and I'm getting this error:
>> -----
>>
>> [javac] [421 units compiled]
>> [javac] ----------
>> [javac] 1. ERROR in
>> /opt/pdfbox/trunk/src/main/java/org/apache/pdfbox/ConvertColorspace.java (at
>> line 1)
>> [javac] /*
>> [javac] ^
>> [javac] The type java.lang.Object cannot be resolved. It is indirectly
>> referenced from required .class files
>> [javac] ----------
>> [javac] 1 problem (1 error)
>>
>> BUILD FAILED
>> /opt/pdfbox/trunk/build.xml:131: Compile failed; see the compiler error
>> output for details.
>> ----
>>
>> Any ideas?
>>
> 

Re: build question

Posted by Daniel Wilson <wi...@gmail.com>.
Not sure, Corwin. I have to think you have something set up wrong, but I
don't know what!

I'm copying the development group as some of the other developers have a lot
more Java experience than I.

Daniel Wilson

On Fri, May 29, 2009 at 11:55 AM, Yu, Corwin <co...@phasecap.com> wrote:

> This one is a definate newbie to ant question. I just installed Ant, and
> the latest SVN pull, and I'm getting this error:
> -----
>
> [javac] [421 units compiled]
> [javac] ----------
> [javac] 1. ERROR in
> /opt/pdfbox/trunk/src/main/java/org/apache/pdfbox/ConvertColorspace.java (at
> line 1)
> [javac] /*
> [javac] ^
> [javac] The type java.lang.Object cannot be resolved. It is indirectly
> referenced from required .class files
> [javac] ----------
> [javac] 1 problem (1 error)
>
> BUILD FAILED
> /opt/pdfbox/trunk/build.xml:131: Compile failed; see the compiler error
> output for details.
> ----
>
> Any ideas?
>

Re: build question

Posted by Daniel Wilson <wi...@gmail.com>.
Not sure, Corwin. I have to think you have something set up wrong, but I
don't know what!

I'm copying the development group as some of the other developers have a lot
more Java experience than I.

Daniel Wilson

On Fri, May 29, 2009 at 11:55 AM, Yu, Corwin <co...@phasecap.com> wrote:

> This one is a definate newbie to ant question. I just installed Ant, and
> the latest SVN pull, and I'm getting this error:
> -----
>
> [javac] [421 units compiled]
> [javac] ----------
> [javac] 1. ERROR in
> /opt/pdfbox/trunk/src/main/java/org/apache/pdfbox/ConvertColorspace.java (at
> line 1)
> [javac] /*
> [javac] ^
> [javac] The type java.lang.Object cannot be resolved. It is indirectly
> referenced from required .class files
> [javac] ----------
> [javac] 1 problem (1 error)
>
> BUILD FAILED
> /opt/pdfbox/trunk/build.xml:131: Compile failed; see the compiler error
> output for details.
> ----
>
> Any ideas?
>