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

Tilman Hausherr commented on PDFBOX-5848:
-----------------------------------------

It finished with 3.0.2 (while I slept) and the snapshot too (with a dirty fix 
for the /Parent problem). I also tried with "-startPage 1 -endPage 442" because 
I'm not sure about the default settings of the splitter class and I never tried 
her code.

I'll do a less dirty fix for the /Parent problem in the next few days.

[~jfisbein-clarity] try setting a higher stack site with "-Xss". The snapshot 
version is at
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.3-SNAPSHOT/


> Infinite loop processing PDF
> ----------------------------
>
>                 Key: PDFBOX-5848
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5848
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 3.0.2 PDFBox
>            Reporter: Joan Fisbein
>            Priority: Major
>         Attachments: cbc0018b-5659-4ae3-9887-0e0a2d9a62a7.pdf, 
> screenshot-1.png
>
>
> I use PDFBox to split hundreds of PDFs per day, generally, everything works 
> flawlessly but I just received a PDF that generates an infinite loop when I 
> try to split it.
>  
> I used this Java code to reproduce it using PDFBox 3.0.2 (haven't tried other 
> versions):
> {code:java}
> private static void splitPdf(File fileToSplit) {
>   try (PDDocument document = Loader.loadPDF(fileToSplit)) {
>     int documentPages = document.getNumberOfPages();
>     Splitter splitter = new Splitter();
>     List<PDDocument> Pages = splitter.split(document);
>     Iterator<PDDocument> iterator = Pages.listIterator();
>     while (iterator.hasNext()) {
>       PDDocument pd = iterator.next();
>       pd.save(fileToSplit.getName() + "-" + Pages.indexOf(pd) + ".pdf");
>       pd.close();
>     }
>   } catch (IOException e) {
>     throw new RuntimeException(e);
>   }
> } {code}
> The PDF file is attached to the issue



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to