Combine Partial pages into a single Page

We have a requirement to search through a PDF Document and find regions of interest and then combine all of the found regions into a single page pdf. The searching seems to be straight forward, I just couldn’t find any documentation regarding “Croping” data from multiple parts of a PDF and combining them into a new single page. We don’t want to have multiple pages.

How would we approach this problem using Apose.Pdf?

@smeverts

Thank you for contacting support.

You can Search and Get Text from All the Pages of PDF Document and then you can Convert a particular page region to Image. Once the images are generated, you can Convert Images to PDF. Next you need to concatenate those PDF files into single PDF document as explained in Concatenate PDF Files and finally use MakeNUp(“a.pdf”, “b.pdf”, Columns, Rows); method to achieve your requirements.

Or, alternatively, you can add a table on a PDF page and add those images in table cells as per your requirements.

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

Is there anyway to do this without rendering it to an image? If I remember correctly, if it’s rendered as an Image all of the pdf data is lost.

And I’m using the JAVA version if that makes a difference.

@smeverts

Rendering to images does not make any changes to data. If you are noticing the data to be lost, then please share respective code and data so that we may try to reproduce and investigate it in our environment. About Java, suggested approach remains the same but the article links will be updated from Aspose.PDF for Java API documentation.

This doesn’t seem to work properly. I have extracted the regions of interest and used cropbox to crop out the data that we don’t need and then I add them as pages to a new PDF file. I call save on that PDF document with a temp filename. I then use PdfFileEditor and specify the tempfilename as the input file and I use 1 column and 2 rows (using the makeNUp method)… when I look at the new output file the 2 pages are on top of each other instead of “concatenated” together to form a single page.

How can I make the software work properly to create my desired output?

@smeverts

Please note that Aspose.PDF for Java API mimics the behavior of Adobe Acrobat. Please try to concatenate the pages of your ‘temp file’ with Adobe Acrobat. Then share source document and generated PDF file to elaborate expected output so that we may investigate further to help you out.