You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2013/08/31 14:36:52 UTC

[jira] [Resolved] (PDFBOX-1653) Fix pdfbox eating up big chunks of memory for identical CID mappings

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

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

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

I've solved the issue in revision 1519174. I didn't applied Christians Patch but used his idea. Mine is easier and I guess we don't need the special handling for the space character.

Thanks for the contribution!
                
> Fix pdfbox eating up big chunks of memory for identical CID mappings
> --------------------------------------------------------------------
>
>                 Key: PDFBOX-1653
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1653
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 1.8.1, 1.8.2, 2.0.0
>            Reporter: Christian Kohlschütter
>            Assignee: Andreas Lehmkühler
>            Priority: Critical
>              Labels: PatchAvailable
>             Fix For: 2.0.0
>
>         Attachments: PDFBOX-1653.patch
>
>
> pdfbox currently handles the PDF beginbfrange command (which creates a character mapping for a range of CIDs to Unicode characters) in a very inefficient way.
> If a PDF document contains a range of CID 0 to CID 65535 with a mapping offset of 0 (which translates to "CID values map 1:1 to Unicode characters", pdfbox would nevertheless map each and every CID.
> There apparently are PDFs with a lot of these 0-65535 mappings, and such a single PDF may cause an OutOfMemoryError.
> This patch detects zero-offset ranges and basically just skips them from an explicit mapping.
> There is some special handling for the space character included in the patch, which might or might not be relevant.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira