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

SUNIL KUMAR SAHU commented on PDFBOX-5990:
------------------------------------------

Below is the peace of code I am using to retrieve the 1st page from the given 
portfolio pdf file in srcFile field-


{code:java}
File srcFile = new File("portfolio_pdf_with_embedded_forms.pdf");
String destination = "some\\location";
try(PDDocument orgDocument = 
PDDocument.load(srcFile,MemoryUsageSetting.setupMixed(dmtsImageDefaultsConfig.getPdfBoxMemoryAllocationInBytes())))
 {
    PDDocument document = new PDDocument();
    PDPage page = new PDPage();
    if (orgDocument.getNumberOfPages() > 0) {
        page = orgDocument.getPage(0);
        document.addPage(page);
        document.save(destination); 
        document.close();
    }
} {code}

> PDFBox unable to render portfolio pdfs embedded with forms with in it
> ---------------------------------------------------------------------
>
>                 Key: PDFBOX-5990
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5990
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>         Environment: Windows, JDK17
>            Reporter: SUNIL KUMAR SAHU
>            Priority: Major
>         Attachments: image-2025-04-22-10-26-31-222.png
>
>
> I want to read/retrieve the 1st page of a portfolio pdf file which is 
> embedded with forms to generate thumbnail & preview. But PDFBox is unable to 
> render the portfolio pdf file which is embedded with forms.  
>  
> I rendered the prortfolio pdf using PDFBox library and extracted the first 
> page to a another pdf. While opening the extracted file it appears as below-
> !image-2025-04-22-10-26-31-222.png!  



--
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