[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023751#comment-17023751
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873181 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1873181 ]

PDFBOX-4750: add test

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023750#comment-17023750
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873180 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1873180 ]

PDFBOX-4750: add test

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023741#comment-17023741
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873179 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873179 ]

PDFBOX-4750: load test file through maven

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023740#comment-17023740
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873178 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1873178 ]

PDFBOX-4750: load test file through maven

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023739#comment-17023739
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873177 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873177 ]

PDFBOX-4750: load test file through maven

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-26 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023738#comment-17023738
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873176 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1873176 ]

PDFBOX-4750: load test file through maven

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023632#comment-17023632
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873162 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873162 ]

PDFBOX-4750: replace test file with one that also writes a dictionary to 
increase test coverage

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023631#comment-17023631
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

Test file of page 8 from the original PDF and the file from PDFBOX-1724 which 
has a dictionary in the content stream, to increase test coverage.

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> PDFBOX-4750-test.pdf, contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023620#comment-17023620
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873160 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1873160 ]

PDFBOX-4750: don't output space after writeObject() which does this itself

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023618#comment-17023618
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873158 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1873158 ]

PDFBOX-4750: don't output space after writeObject() which does this itself

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023619#comment-17023619
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873159 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873159 ]

PDFBOX-4750: don't output space after writeObject() which does this itself

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023589#comment-17023589
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

Test was also to see whether we increased code coverage. Sadly it dropped from 
46% to 45.6% (maybe because of other commits that balanced things differently). 
The code coverage of the class went up to 79.6% from 43.4%.

TODOs:
- use only page 8
- same test for 2.0
- loading of file through pom
- find whether file that has dictionary (isn't covered)
- correct formatting for dictionary (probably unneeded space)

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023562#comment-17023562
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873152 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873152 ]

PDFBOX-4750: use new Loader class

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023560#comment-17023560
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873151 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873151 ]

PDFBOX-4750: use new Loader class

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023552#comment-17023552
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873150 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873150 ]

PDFBOX-4750: add test

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023527#comment-17023527
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

Snapshot available at
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.19-SNAPSHOT/

I also did a test on the attached file, with this code:
{code}
try (PDDocument doc = PDFParser.load(new File("/PDFBOX-4750.pdf")))
{
PDFRenderer r = new PDFRenderer(doc);
for (int i = 0; i < doc.getNumberOfPages(); ++i)
{
BufferedImage bim1 = r.renderImageWithDPI(i, 96);
ImageIO.write(bim1, "png", new File("/in/PDFBOX-4750-saved.pdf-" + 
(i+1) + ".png"));
PDPage page = doc.getPage(i);
PDStream newContent = new PDStream(doc);
try (InputStream is = page.getContents();
 OutputStream os = 
newContent.createOutputStream(COSName.FLATE_DECODE))
{
PDFStreamParser parser = new PDFStreamParser(is);
parser.parse();
ContentStreamWriter tokenWriter = new ContentStreamWriter(os);
tokenWriter.writeTokens(parser.getTokens());
}
page.setContents(newContent);
}
doc.save(new File("/PDFBOX-4750-saved.pdf"));

}
TestPDFToImage testPDFToImage = new 
TestPDFToImage(TestPDFToImage.class.getName());
if (!testPDFToImage.doTestFile(new File("/PDFBOX-4750-saved.pdf"), 
"/in", "/out"))
{
fail("Rendering failed or is not identical");
}
{code}
and it succeeded. It also succeeded after the first commit. The following ones 
are for clarity and to prevent having too many unneeded spaces in the modified 
content stream. You should use the test code above to create your own test. It 
creates a first rendering set in the "in" directory and then modifies the file 
and then compares the renderings.

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong 

[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023477#comment-17023477
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873136 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1873136 ]

PDFBOX-4750: don't output space after writeObject() which does this itself; put 
space after "]"; remove space before "null"; put LF after "BI".

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023480#comment-17023480
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873138 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1873138 ]

PDFBOX-4750: don't output space after writeObject() which does this itself; put 
space after "]"; remove space before "null"; put LF after "BI".

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023478#comment-17023478
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873137 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873137 ]

PDFBOX-4750: don't output space after writeObject() which does this itself; put 
space after "]"; remove space before "null"; put LF after "BI".

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023468#comment-17023468
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873135 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1873135 ]

PDFBOX-4750: allow to rewrite null object, as suggested by Tomas Kochan

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023467#comment-17023467
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873134 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1873134 ]

PDFBOX-4750: allow to rewrite null object, as suggested by Tomas Kochan

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-25 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023466#comment-17023466
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873133 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873133 ]

PDFBOX-4750: allow to rewrite null object, as suggested by Tomas Kochan

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023193#comment-17023193
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873114 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1873114 ]

PDFBOX-4750: show null object in content stream pane

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023191#comment-17023191
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873112 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1873112 ]

PDFBOX-4750: show null object in content stream pane

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023192#comment-17023192
 ] 

ASF subversion and git services commented on PDFBOX-4750:
-

Commit 1873113 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1873113 ]

PDFBOX-4750: show null object in content stream pane

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023187#comment-17023187
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

We usually do releases every 3-4 months, and the last one was around christmas.

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread tomas kochan (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023168#comment-17023168
 ] 

tomas kochan commented on PDFBOX-4750:
--

Thank you as well. Could you please tell me when the next release is expecting 
to be available?

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Assignee: Tilman Hausherr
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17023165#comment-17023165
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

Thank you. I'll fix this, also the bug in PDFDebugger, and it will be in the 
next release and until then in a snapshot (after comitting).

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>  Components: Writing
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Priority: Major
> Fix For: 2.0.19, 3.0.0 PDFBox
>
> Attachments: 01 - K17 - Was dahinter steckt - dsb.pdf, 
> contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-24 Thread tomas kochan (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17022862#comment-17022862
 ] 

tomas kochan commented on PDFBOX-4750:
--

The document doesn't contain confidential data. I've attached it here. The 
COSNull Element appears at Page 8.

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Priority: Major
> Attachments: contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-23 Thread tomas kochan (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17022743#comment-17022743
 ] 

tomas kochan commented on PDFBOX-4750:
--

Yes the /DP segment was by PDFDebugger transformed into spaces - Probably he 
can correctly recognize COSNull Element and write it as a empty string in the 
result - you can check it in your code. No the null thing is on the page I sent 
you.

When I am debugging the content of the Document, I can see the following Java 
Objects:
 # PDFStreamParser parser = new PDFStreamParser(page);
 ## loop parser.getTokens()
 # One Token is PDFOperator\{BI} - saved in local property op
 # COSDictionary dic = op.getImageParameters();
 # dic.toString() returns: 
COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},
 COSName\{DCT}]};COSName\{DP}:COSArray\{[COSNull{}, COSNull{}]};}

I am checking if I can share the whole file with you, but I think it's not 
necessary. The method ContentStreamWriter.writeObject should accept COSNull 
Object in the same way as the PDFDebugger does.

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Priority: Major
> Attachments: contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull 

[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-23 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17022695#comment-17022695
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

Uhm, if you can't share the file, then I hope the actual content here isn't 
confidential, the text starts with "in der von uns unter" so check whether the 
page text is harmless.

The /DP [   ] segment is just three spaces. Could it be that the "null" thing 
is in another page? Or check with the hex viewer in PDFDebugger. Or was the 
"null" inserted by the software that modified the content stream? Or was 
something lost in copy & paste?

This code works fine:
{code}
PDFStreamParser parser = new PDFStreamParser(new 
FileInputStream("contentAllOperatorsOfCorruptedPage.txt"));
List tokens = parser.getTokens();
ContentStreamWriter tokenWriter = new ContentStreamWriter(new 
ByteArrayOutputStream());
tokenWriter.writeTokens(tokens);
{code}


> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Priority: Major
> Attachments: contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: 

[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-23 Thread tomas kochan (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17022684#comment-17022684
 ] 

tomas kochan commented on PDFBOX-4750:
--

I attached the whole content of corrupted page, extracted from PDFDebugger. At 
the end you can see the operator /DP:

/Interpolate true 
/W 35 
/H 26 
/CS /RGB 
/BPC 8 
/F [ /A85 /DCT ] 
/DP [ ]

 

Unfortunately I can't share the original pdf file.

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Priority: Major
> Attachments: contentAllOperatorsOfCorruptedPage.txt
>
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4750) java.io.IOException: Error:Unknown type in content stream:COSNull{}

2020-01-23 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17022405#comment-17022405
 ] 

Tilman Hausherr commented on PDFBOX-4750:
-

Can you share the file? /DP here is an abbreviation for DecodeParms, which can 
be an array of dictionaries. It almost makes sense, the filter is an array with 
2 elements, A85 and DCT, so DecodeParms if it exists, should have two entries. 
And yes, it seems that we should support null.

If you can't share the file, could you share a screenshot of the content 
stream? Open it with PDFDebugger and then search the content stream for "/DP" 
or "null".

> java.io.IOException: Error:Unknown type in content stream:COSNull{}
> ---
>
> Key: PDFBOX-4750
> URL: https://issues.apache.org/jira/browse/PDFBOX-4750
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.8, 2.0.18
>Reporter: tomas kochan
>Priority: Major
>
> By removing some optional content for specific document, which is bordered 
> with Operator BDC and EMC, we are facing an issue by writing the changed set 
> of tokens into PDStream. 
>  The code looks like:
>  PDStream updatedStream = new PDStream(document);
>  OutputStream out = updatedStream.getCOSObject().createRawOutputStream();
>  ContentStreamWriter tokenWriter = new ContentStreamWriter(out);
>  tokenWriter.writeTokens(result);
>  out.flush();
>  out.close();
>  page.setContents(updatedStream);
>   
>  The following exception occurs at line 'tokenWriter.writeTokens(result);' :
>  java.io.IOException: Error:Unknown type in content stream:COSNull{}
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:199)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:146)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(ContentStreamWriter.java:181)
>  at 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens(ContentStreamWriter.java:109)
>  at 
> de.justiz.eip.pdf.tools.PdfContext.getOrRemoveOptionalTextContentfromPage(PdfContext.java:429)
>  at 
> de.justiz.eip.pdf.tools.paging.PagingInfoInterpreterPdfContext.removePagingInfo(PagingInfoInterpreterPdfContext.java:325)
>  
> After the analyze we figured out two issues:
>  1. We assume, the Pdf Document it's self is corrupted, It contains on some 
> place operator BI, which is based on the PDF-Reference-V1.7 a begin of inline 
> image object. This Operator is not followed by "ID" or "EI" operator. 
>  Extract from list of Tokens:
>  next PDFOperator\{Do}
> next COSFloat\{0.016674607}
> next COSInt\{0}
>  next COSInt\{0}
> next COSFloat\{0.061831153}
> next COSFloat\{0.070509767}
> next COSFloat\{-0.302021403}
>  next PDFOperator\{cm}
> next PDFOperator\{BI}
> next PDFOperator\{Q}
>  next PDFOperator\{Q}
> next COSName\{OC}
> next COSName\{eAkteOptionalContent7}
> next PDFOperator\{BDC}
> Moreover one "DP" Entry in the "BI" operator's COSDictionary contains 
> COSArray with COSNull values. However the assumption is, that the COSNull 
> values are not forbidden in the Pdf content. 
>  
> COSDictionary\{COSName{Interpolate}:true;COSName\{W}:COSInt\{35};COSName\{H}:COSInt\{26};COSName\{CS}:COSName\{RGB};COSName\{BPC}:COSInt\{8};COSName\{F}:COSArray\{[COSName{A85},COSName\{DCT}]};COSName\{DP}:COSArray{[COSNull{},COSNull{}]};}
> 2. Despite wrong content in the pdf-document (described above) the PDF-Box 
> api crashed by storing this operators into PDStream by his inability to 
> recognize COSNull in the method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)
>  
> The assumption on this place is, that the method "writeObject" forgot to 
> cover COSNull  as an valid input. The org.apache.pdfbox.cos.COSNull.NULL is 
> valid Object, which is broadly used by PDF-Api itself.
> The Method 
> org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeObject(Object)  PDF-Api 
> 2.0.8, also in 2.0.18 doesn't cover the COSNull  case in it's if/else 
> conditions, instead of it throws the new IOException( "Error:Unknown type in 
> content stream:" + o ). 
>  
> Could you confirm, that the method writeObject contains bug and should be 
> corrected to cover also COSNull Object? If so, in which version could we 
> expect the fix?
> Thank you
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org