You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Lucas Milne (Created) (JIRA)" <ji...@apache.org> on 2011/11/17 00:49:51 UTC

[jira] [Created] (PDFBOX-1173) Missing Fonts after PDFMergerUtility mergeDocuments

Missing Fonts after PDFMergerUtility mergeDocuments
---------------------------------------------------

                 Key: PDFBOX-1173
                 URL: https://issues.apache.org/jira/browse/PDFBOX-1173
             Project: PDFBox
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 1.6.0
         Environment: CentOS 5.6, Java 6
            Reporter: Lucas Milne


After using the PDFMergeUtility, the fonts for all documents but the first seem to be discarded.  

CODE:
public class PDFMergeTest {

	public static void main(String[] args) {
		PDFMergerUtility mergePdf = new PDFMergerUtility();		
		mergePdf.addSource("/home/lucas/control/issue/blankPage.pdf");
		mergePdf.addSource("/home/lucas/control/issue/Milne_Lucas_Resume_2011.pdf");
		mergePdf.setDestinationFileName("/home/lucas/control/issue/broken_merge.pdf");
		mergePdf.setIgnoreAcroFormErrors(false);
		try {
			mergePdf.mergeDocuments();
		} catch (COSVisitorException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

Output from pdffonts:
[lucas@star issue]$ ll
total 3332
-rw-rw-r-- 1 lucas lucas   11433 Nov 16 14:19 blankPage.pdf
-rw-rw-r-- 1 lucas lucas 1703635 Nov 16 15:47 broken_merge.pdf
-rw-rw-r-- 1 lucas lucas 1685246 Nov 16 14:19 Milne_Lucas_Resume_2011.pdf

[lucas@star issue]$ pdffonts blankPage.pdf 
name                                 type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
EZSZAN+Helvetica                     TrueType     yes yes no       8  0

[lucas@star issue]$ pdffonts Milne_Lucas_Resume_2011.pdf 
name                                 type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
CourierNew                           CID TrueType yes no  yes      7  0
SegoeUI                              CID TrueType yes no  yes     11  0
Calibri                              CID TrueType yes no  yes     14  0
Calibri,Bold                         CID TrueType yes no  yes     17  0
Symbol                               CID TrueType yes no  yes     20  0
TimesNewRoman                        CID TrueType yes no  yes     25  0

[lucas@star issue]$ pdffonts broken_merge.pdf 
name                                 type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
EZSZAN+Helvetica                     TrueType     yes yes no      32  0


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PDFBOX-1173) Missing Fonts after PDFMergerUtility mergeDocuments

Posted by "Andreas Lehmkühler (Updated JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler updated PDFBOX-1173:
---------------------------------------

    Attachment: PDFBOX1173-result.pdf

The resulting pdf after fixing this issue
                
> Missing Fonts after PDFMergerUtility mergeDocuments
> ---------------------------------------------------
>
>                 Key: PDFBOX-1173
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1173
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.6.0
>         Environment: CentOS 5.6, Java 6
>            Reporter: Lucas Milne
>         Attachments: Milne_Lucas_Resume_2011.pdf, PDFBOX1173-result.pdf, blankPage.pdf, broken_merge.pdf
>
>
> After using the PDFMergeUtility, the fonts for all documents but the first seem to be discarded.  
> CODE:
> public class PDFMergeTest {
> 	public static void main(String[] args) {
> 		PDFMergerUtility mergePdf = new PDFMergerUtility();		
> 		mergePdf.addSource("/home/lucas/control/issue/blankPage.pdf");
> 		mergePdf.addSource("/home/lucas/control/issue/Milne_Lucas_Resume_2011.pdf");
> 		mergePdf.setDestinationFileName("/home/lucas/control/issue/broken_merge.pdf");
> 		mergePdf.setIgnoreAcroFormErrors(false);
> 		try {
> 			mergePdf.mergeDocuments();
> 		} catch (COSVisitorException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		} catch (IOException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
> 	}
> }
> Output from pdffonts:
> [lucas@star issue]$ ll
> total 3332
> -rw-rw-r-- 1 lucas lucas   11433 Nov 16 14:19 blankPage.pdf
> -rw-rw-r-- 1 lucas lucas 1703635 Nov 16 15:47 broken_merge.pdf
> -rw-rw-r-- 1 lucas lucas 1685246 Nov 16 14:19 Milne_Lucas_Resume_2011.pdf
> [lucas@star issue]$ pdffonts blankPage.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> EZSZAN+Helvetica                     TrueType     yes yes no       8  0
> [lucas@star issue]$ pdffonts Milne_Lucas_Resume_2011.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> CourierNew                           CID TrueType yes no  yes      7  0
> SegoeUI                              CID TrueType yes no  yes     11  0
> Calibri                              CID TrueType yes no  yes     14  0
> Calibri,Bold                         CID TrueType yes no  yes     17  0
> Symbol                               CID TrueType yes no  yes     20  0
> TimesNewRoman                        CID TrueType yes no  yes     25  0
> [lucas@star issue]$ pdffonts broken_merge.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> EZSZAN+Helvetica                     TrueType     yes yes no      32  0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (PDFBOX-1173) Missing Fonts after PDFMergerUtility mergeDocuments

Posted by "Lucas Milne (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lucas Milne updated PDFBOX-1173:
--------------------------------

    Attachment: Milne_Lucas_Resume_2011.pdf
                broken_merge.pdf
                blankPage.pdf

blankPage.pdf is added first, then Milne_Lucas_Resume_2011.pdf is added.  The broken_merge.pdf file is created by the PDFMergerUtility.
                
> Missing Fonts after PDFMergerUtility mergeDocuments
> ---------------------------------------------------
>
>                 Key: PDFBOX-1173
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1173
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.6.0
>         Environment: CentOS 5.6, Java 6
>            Reporter: Lucas Milne
>         Attachments: Milne_Lucas_Resume_2011.pdf, blankPage.pdf, broken_merge.pdf
>
>
> After using the PDFMergeUtility, the fonts for all documents but the first seem to be discarded.  
> CODE:
> public class PDFMergeTest {
> 	public static void main(String[] args) {
> 		PDFMergerUtility mergePdf = new PDFMergerUtility();		
> 		mergePdf.addSource("/home/lucas/control/issue/blankPage.pdf");
> 		mergePdf.addSource("/home/lucas/control/issue/Milne_Lucas_Resume_2011.pdf");
> 		mergePdf.setDestinationFileName("/home/lucas/control/issue/broken_merge.pdf");
> 		mergePdf.setIgnoreAcroFormErrors(false);
> 		try {
> 			mergePdf.mergeDocuments();
> 		} catch (COSVisitorException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		} catch (IOException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
> 	}
> }
> Output from pdffonts:
> [lucas@star issue]$ ll
> total 3332
> -rw-rw-r-- 1 lucas lucas   11433 Nov 16 14:19 blankPage.pdf
> -rw-rw-r-- 1 lucas lucas 1703635 Nov 16 15:47 broken_merge.pdf
> -rw-rw-r-- 1 lucas lucas 1685246 Nov 16 14:19 Milne_Lucas_Resume_2011.pdf
> [lucas@star issue]$ pdffonts blankPage.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> EZSZAN+Helvetica                     TrueType     yes yes no       8  0
> [lucas@star issue]$ pdffonts Milne_Lucas_Resume_2011.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> CourierNew                           CID TrueType yes no  yes      7  0
> SegoeUI                              CID TrueType yes no  yes     11  0
> Calibri                              CID TrueType yes no  yes     14  0
> Calibri,Bold                         CID TrueType yes no  yes     17  0
> Symbol                               CID TrueType yes no  yes     20  0
> TimesNewRoman                        CID TrueType yes no  yes     25  0
> [lucas@star issue]$ pdffonts broken_merge.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> EZSZAN+Helvetica                     TrueType     yes yes no      32  0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PDFBOX-1173) Missing Fonts after PDFMergerUtility mergeDocuments

Posted by "Andreas Lehmkühler (Resolved JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-1173.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.0
         Assignee: Andreas Lehmkühler

The PDFMergerUtility just merged the resources of each page but left The document wide resources which are shared with all pages alone. I fixed that in revision 1224791. 

Thanks for the report!
                
> Missing Fonts after PDFMergerUtility mergeDocuments
> ---------------------------------------------------
>
>                 Key: PDFBOX-1173
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1173
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.6.0
>         Environment: CentOS 5.6, Java 6
>            Reporter: Lucas Milne
>            Assignee: Andreas Lehmkühler
>             Fix For: 1.7.0
>
>         Attachments: Milne_Lucas_Resume_2011.pdf, PDFBOX1173-result.pdf, blankPage.pdf, broken_merge.pdf
>
>
> After using the PDFMergeUtility, the fonts for all documents but the first seem to be discarded.  
> CODE:
> public class PDFMergeTest {
> 	public static void main(String[] args) {
> 		PDFMergerUtility mergePdf = new PDFMergerUtility();		
> 		mergePdf.addSource("/home/lucas/control/issue/blankPage.pdf");
> 		mergePdf.addSource("/home/lucas/control/issue/Milne_Lucas_Resume_2011.pdf");
> 		mergePdf.setDestinationFileName("/home/lucas/control/issue/broken_merge.pdf");
> 		mergePdf.setIgnoreAcroFormErrors(false);
> 		try {
> 			mergePdf.mergeDocuments();
> 		} catch (COSVisitorException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		} catch (IOException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
> 	}
> }
> Output from pdffonts:
> [lucas@star issue]$ ll
> total 3332
> -rw-rw-r-- 1 lucas lucas   11433 Nov 16 14:19 blankPage.pdf
> -rw-rw-r-- 1 lucas lucas 1703635 Nov 16 15:47 broken_merge.pdf
> -rw-rw-r-- 1 lucas lucas 1685246 Nov 16 14:19 Milne_Lucas_Resume_2011.pdf
> [lucas@star issue]$ pdffonts blankPage.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> EZSZAN+Helvetica                     TrueType     yes yes no       8  0
> [lucas@star issue]$ pdffonts Milne_Lucas_Resume_2011.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> CourierNew                           CID TrueType yes no  yes      7  0
> SegoeUI                              CID TrueType yes no  yes     11  0
> Calibri                              CID TrueType yes no  yes     14  0
> Calibri,Bold                         CID TrueType yes no  yes     17  0
> Symbol                               CID TrueType yes no  yes     20  0
> TimesNewRoman                        CID TrueType yes no  yes     25  0
> [lucas@star issue]$ pdffonts broken_merge.pdf 
> name                                 type         emb sub uni object ID
> ------------------------------------ ------------ --- --- --- ---------
> EZSZAN+Helvetica                     TrueType     yes yes no      32  0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira