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

Maruan Sahyoun commented on PDFBOX-1625:
----------------------------------------

I'm happy to help working on the COS layer (currently working on the 
parser/lexer). Maybe we share some ideas and get them documented on the ideas 
page for 2.0.

As for cloning etc. I'd prefer buffering on disc (if needed) on the new 
document instead of keeping files open. E.g. for a customer we are merging 
50.000 files that's a lot of resources to keep open. And I think it simply is 
not inline with ones expectation that cloning or importing means referencing to 
some extend. 
                
> java.lang.IndexOutOfBoundsException at writing PDF file
> -------------------------------------------------------
>
>                 Key: PDFBOX-1625
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1625
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 1.8.2
>         Environment: Linux, Java 7u21 
>            Reporter: Jens Kapitza
>            Assignee: Guillaume Bailleul
>            Priority: Minor
>         Attachments: noclose-2.patch, noclose.patch, pdftool.zip
>
>
> I got this error:
> i will just recreate a document with pages 1-6.
> Exception in thread "main" java.io.IOException: 
> org.apache.pdfbox.exceptions.COSVisitorException: 
> java.lang.IndexOutOfBoundsException: Index: 115, Size: 0
>       at 
> de.back2heaven.pdf.model.TargetDocumuent.save(TargetDocumuent.java:56)
>       at de.back2heaven.pdf.model.Document.prozess(Document.java:76)
>       at de.back2heaven.pdf.model.Document.main(Document.java:56)
> Caused by: org.apache.pdfbox.exceptions.COSVisitorException: 
> java.lang.IndexOutOfBoundsException: Index: 115, Size: 0
>       at 
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1354)
>       at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:217)
>       at org.apache.pdfbox.cos.COSObject.accept(COSObject.java:206)
>       at 
> org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:525)
>       at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:435)
>       at 
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1122)
>       at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:552)
>       at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1501)
>       at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1324)
>       at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1305)
>       at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1292)
>       at 
> de.back2heaven.pdf.model.TargetDocumuent.save(TargetDocumuent.java:54)
>       ... 2 more
> Caused by: java.lang.IndexOutOfBoundsException: Index: 115, Size: 0
>       at java.util.ArrayList.rangeCheck(ArrayList.java:604)
>       at java.util.ArrayList.get(ArrayList.java:382)
>       at 
> org.apache.pdfbox.io.RandomAccessBuffer.seek(RandomAccessBuffer.java:84)
>       at 
> org.apache.pdfbox.io.RandomAccessFileInputStream.read(RandomAccessFileInputStream.java:96)
>       at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
>       at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
>       at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
>       at 
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1337)
>       ... 13 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to