You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by John Liston <li...@asconline.com> on 2016/02/19 20:56:13 UTC

Problem displaying PDFBox 2.0RC3 document in Acrobat Reader

A document generated using PDFBox 2.0.0-RC3 cannot be read fully by the latest version of Adobe Acrobat Reader, which says "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem."  The identical document created using PDFBox 1.8.11 reads in Acrobat Reader just fine.  After using Acrobat Pro to increase the width of the bounding box around the first page text "Can this amount change after closing?", the rest of the text on the page showed up.  The same problem showed up with other text on the following pages. Both documents read and display properly using PDFBox PDFDebugger.

www.pdf-tools.com/pdf/validate-pdfa-online.aspx says the differences between the 1.8.11 analysis and the 2.0.0-RC3 analysis are:
               The key Type is required but missing. (2)
               The operator has an invalid number of operands. (5)
               The document doesn't conform to the PDF reference (missing required entries, wrong value types, etc.)

The font being used is PDType1Font.HELVETICA. The code being used to print the text is straightforward:
try {
               // position is offset from the bottom left corner of the page
               pdContent.beginText();
               // (the font is set in a prior .font() call)
               // 1/2016 1.x: pdContent.moveTextPositionByAmount(points(dHoriz), posY(dVert));
               pdContent.newLineAtOffset(points(dHoriz), posY(dVert));
               // 1/2016: pdContent.drawString(textOrCallback.toString());
               pdContent.showText(textOrCallback.toString());
               pdContent.endText();
}
catch (IOException ioe) {
               // (unlikely)
               throw new RuntimeException(ioe);
}
We substituted the (deprecated) .drawString() for .showText() with the same error result.

The 1.8.11 and 2.0.0-RC3 documents can be retrieved at:
https://www.dropbox.com/s/3j9bkfw5a9n2tag/CFPBClosingDisclosure-PDFBox1811.pdf?dl=0 
https://www.dropbox.com/s/uv696rpah8nzxlv/CFPBClosingDisclosure-PDFBox200RC3.pdf?dl=0 

Please let us know what more we can do or provide to help resolve this problem. Thanks. 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Problem displaying PDFBox 2.0RC3 document in Acrobat Reader

Posted by Tilman Hausherr <TH...@t-online.de>.
I most probably found the cause of the other problem as well. Everywhere 
where there's an "sc" command, I added

/DeviceRGB cs

just before. Now it passes the PDF-Tools test and is displayed by Adobe 
Reader.

I suspect that this was fixed yesterday, but I'm not sure.

http://svn.apache.org/viewvc?rev=1731092&view=rev


Could you please retest your application with a current snapshot?


Tilman

Am 19.02.2016 um 21:35 schrieb Tilman Hausherr:
> I see one difference that was fixed just a few hours ago. 
> (PDFBOX-3240) That is the "The key Type is required but missing" problem.
>
> I fixed that manually but it isn't enough. Next thing is to find out 
> why the "The operator has an invalid number of operands. (5)".
>
> Tilman
>
> Am 19.02.2016 um 20:56 schrieb John Liston:
>> A document generated using PDFBox 2.0.0-RC3 cannot be read fully by 
>> the latest version of Adobe Acrobat Reader, which says "An error 
>> exists on this page. Acrobat may not display the page correctly. 
>> Please contact the person who created the PDF document to correct the 
>> problem." The identical document created using PDFBox 1.8.11 reads in 
>> Acrobat Reader just fine.  After using Acrobat Pro to increase the 
>> width of the bounding box around the first page text "Can this amount 
>> change after closing?", the rest of the text on the page showed up.  
>> The same problem showed up with other text on the following pages. 
>> Both documents read and display properly using PDFBox PDFDebugger.
>>
>> www.pdf-tools.com/pdf/validate-pdfa-online.aspx says the differences 
>> between the 1.8.11 analysis and the 2.0.0-RC3 analysis are:
>>                 The key Type is required but missing. (2)
>>                 The operator has an invalid number of operands. (5)
>>                 The document doesn't conform to the PDF reference 
>> (missing required entries, wrong value types, etc.)
>>
>> The font being used is PDType1Font.HELVETICA. The code being used to 
>> print the text is straightforward:
>> try {
>>                 // position is offset from the bottom left corner of 
>> the page
>>                 pdContent.beginText();
>>                 // (the font is set in a prior .font() call)
>>                 // 1/2016 1.x: 
>> pdContent.moveTextPositionByAmount(points(dHoriz), posY(dVert));
>>                 pdContent.newLineAtOffset(points(dHoriz), posY(dVert));
>>                 // 1/2016: 
>> pdContent.drawString(textOrCallback.toString());
>>                 pdContent.showText(textOrCallback.toString());
>>                 pdContent.endText();
>> }
>> catch (IOException ioe) {
>>                 // (unlikely)
>>                 throw new RuntimeException(ioe);
>> }
>> We substituted the (deprecated) .drawString() for .showText() with 
>> the same error result.
>>
>> The 1.8.11 and 2.0.0-RC3 documents can be retrieved at:
>> https://www.dropbox.com/s/3j9bkfw5a9n2tag/CFPBClosingDisclosure-PDFBox1811.pdf?dl=0 
>>
>> https://www.dropbox.com/s/uv696rpah8nzxlv/CFPBClosingDisclosure-PDFBox200RC3.pdf?dl=0 
>>
>>
>> Please let us know what more we can do or provide to help resolve 
>> this problem. Thanks.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Problem displaying PDFBox 2.0RC3 document in Acrobat Reader

Posted by Tilman Hausherr <TH...@t-online.de>.
I see one difference that was fixed just a few hours ago. (PDFBOX-3240) 
That is the "The key Type is required but missing" problem.

I fixed that manually but it isn't enough. Next thing is to find out why 
the "The operator has an invalid number of operands. (5)".

Tilman

Am 19.02.2016 um 20:56 schrieb John Liston:
> A document generated using PDFBox 2.0.0-RC3 cannot be read fully by the latest version of Adobe Acrobat Reader, which says "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem."  The identical document created using PDFBox 1.8.11 reads in Acrobat Reader just fine.  After using Acrobat Pro to increase the width of the bounding box around the first page text "Can this amount change after closing?", the rest of the text on the page showed up.  The same problem showed up with other text on the following pages. Both documents read and display properly using PDFBox PDFDebugger.
>
> www.pdf-tools.com/pdf/validate-pdfa-online.aspx says the differences between the 1.8.11 analysis and the 2.0.0-RC3 analysis are:
>                 The key Type is required but missing. (2)
>                 The operator has an invalid number of operands. (5)
>                 The document doesn't conform to the PDF reference (missing required entries, wrong value types, etc.)
>
> The font being used is PDType1Font.HELVETICA. The code being used to print the text is straightforward:
> try {
>                 // position is offset from the bottom left corner of the page
>                 pdContent.beginText();
>                 // (the font is set in a prior .font() call)
>                 // 1/2016 1.x: pdContent.moveTextPositionByAmount(points(dHoriz), posY(dVert));
>                 pdContent.newLineAtOffset(points(dHoriz), posY(dVert));
>                 // 1/2016: pdContent.drawString(textOrCallback.toString());
>                 pdContent.showText(textOrCallback.toString());
>                 pdContent.endText();
> }
> catch (IOException ioe) {
>                 // (unlikely)
>                 throw new RuntimeException(ioe);
> }
> We substituted the (deprecated) .drawString() for .showText() with the same error result.
>
> The 1.8.11 and 2.0.0-RC3 documents can be retrieved at:
> https://www.dropbox.com/s/3j9bkfw5a9n2tag/CFPBClosingDisclosure-PDFBox1811.pdf?dl=0
> https://www.dropbox.com/s/uv696rpah8nzxlv/CFPBClosingDisclosure-PDFBox200RC3.pdf?dl=0
>
> Please let us know what more we can do or provide to help resolve this problem. Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org