Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.1 PDFBox, 4.0.0
-
None
Description
(This may or may not be a duplicate of PDFBOX-5752)
I ran the code by Fabian Zünd from the users mailing list, and used as input 3 pages from the PDF specification that I got by using PDFSplit with PDFBox 2.0.31-SNAPSHOT. In page 2 and 3 of the destination some of the annotations point to the wrong object.
System.out.println("Generating Document"); //Generate Empty Document PDDocument Document = new PDDocument(); PDAcroForm Form = new PDAcroForm(Document); PDResources Resources = new PDResources(); Resources.put(COSName.HELV, new PDType1Font(FontName.HELVETICA)); Document.getDocumentCatalog().setAcroForm(Form); Form.setDefaultResources(Resources); Form.setDefaultAppearance("/Helv 0 Tf 0 g"); //Templates PDF's File dir = new File("c:/users/tilman/downloads"); File PDFRef1 = new File(dir, "pdf_32000_2008-1.pdf"); File PDFRef2 = new File(dir, "pdf_32000_2008-2.pdf"); File PDFRef3 = new File(dir, "pdf_32000_2008-3.pdf"); //Load the Templates System.out.println("Loading Template Documents"); PDDocument PDF1 = Loader.loadPDF(PDFRef1); PDDocument PDF2 = Loader.loadPDF(PDFRef2); PDDocument PDF3 = Loader.loadPDF(PDFRef3); //Get the First Page of the Template PDF's PDPage PDF1Page = PDF1.getPage(0); PDPage PDF2Page = PDF2.getPage(0); PDPage PDF3Page = PDF3.getPage(0); System.out.println("Importing Pages"); //Import all pages PDPage PDF1Imported = Document.importPage(PDF1Page); PDPage PDF2Imported = Document.importPage(PDF2Page); PDPage PDF3Imported = Document.importPage(PDF3Page); System.out.println("Saving Document"); File Export = new File(dir, "Export.pdf"); if (Export.exists()) { Export.delete(); } Document.save(Export); System.out.println("Done");
Attachments
Attachments
Issue Links
- is fixed by
-
PDFBOX-5752 Font errors after copying a page to another document
- Closed