Solved

How to duplicate a copy of existing PDF document and insert a new page to the beginning of the duplicated PDF document using iText

Posted on 2013-10-29
1
2,085 Views
Last Modified: 2013-11-04
Dear experts,

I'm new to iText. Anyone can provide a guideline "How to duplicate a copy of existing PDF document and insert a new page to the beginning of the duplicated PDF document using iText?"

For example, which Java classes/methods of iText is able to handle the copy / duplication of the existing PDF document.

Also, the way to insert a new page to the beginning of the duplicated PDF document.

Kindly please advise.
Thanks.
0
Comment
Question by:wintersun
1 Comment
 
LVL 19

Accepted Solution

by:
mrwad99 earned 400 total points
ID: 39611165
OK.  First, you need to use the PdfCopy class.  From the offical documentation: http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfCopy.html

You then need to insert a page using the InsertPages class.  See http://itextpdf.com/examples/iia.php?id=120.

I haven't quoted the code here because it is all explained in the tutorial above.

HTH
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Class Structure 3 121
twoTwo  challenge 35 103
Document Exchange Portals 6 65
Service Catalogue and Data Migration doc 3 42
PaperPort 14.5 Patch 1 update is often not detected or downloaded automatically. This article provides direct download links to solve the problem for retail (non-bundled) versions of the Standard and Professional editions, as well as the Professiona…
Online collaboration can help businesses be more efficient, help employees grow their skills and foster a team environment.
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question