You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/05/13 08:40:17 UTC

[jira] [Reopened] (PDFBOX-2073) PDF files with unusual Japanese font can not be rewrite correctly

     [ https://issues.apache.org/jira/browse/PDFBOX-2073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr reopened PDFBOX-2073:
-------------------------------------


Thank you, this (and the PDF spec "name objects") confirms that there could be any value there. I will change this tonight to skip encoding only for those characters that are obvious (a-z,A-Z,0-9) and those explicitly not shown converted in the spec, to avoid getting this problem in the future.

> PDF files with unusual Japanese font can not be rewrite correctly
> -----------------------------------------------------------------
>
>                 Key: PDFBOX-2073
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2073
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.5, 1.8.6, 2.0.0
>         Environment: Windows 7 32bit
>            Reporter: May Yu
>            Assignee: Tilman Hausherr
>            Priority: Critical
>              Labels: encoding
>             Fix For: 1.8.6, 2.0.0
>
>         Attachments: font_screenshot1.png, landscape.pdf, pdf_property.png
>
>
> While rotate attached pdf file, The Japanese characters cannot display in the output pdf file. 
> This problem can also occur when marge PDF files.
> We suspect that this caused by the name of font type.
> Environment
> -------------------------------------------------
> OS    : Windows 7 (32bit)
> jvm   : 1.6
> pdfbox: 1.8.5
> -------------------------------------------------
> Code to reproduce the problem
> -------------------------------------------------
>     public static void main(String[] args) {
>         String filePath = "D:\\test\\landscape.pdf";
>         String newPDFFile = "D:\\test\\new_landscape.pdf";
>         try {
>             PDDocument rotatedDocument = PDDocument.load(filePath);
>             PDDocument document = new PDDocument();
>             int pageNumber = document.getNumberOfPages();
>             for (int i=0; i<pageNumber; i++) {
>                 PDPage page = (PDPage)document.getDocumentCatalog().getAllPages().get(i);
>                 page.setRotation(-90);
>                 rotatedDocument.addPage(page);
>             }
>             rotatedDocument.save(newPDFFile);
>             document.close();
>             rotatedDocument.close();
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
> -------------------------------------------------



--
This message was sent by Atlassian JIRA
(v6.2#6252)