Menu

#67 Error extracting text - PDF created by Google Chrome print option

0.1.2.1
closed-fixed
None
1
2015-04-28
2015-04-28
No

I'm getting this error when I try to extract the text from some PDFs:

Unable to cast object of type 'org.pdfclown.objects.PdfReal' to type org.pdfclown.objects.PdfInteger'.
em org.pdfclown.documents.contents.fonts.CompositeFont.OnLoad()
em org.pdfclown.documents.contents.fonts.Font.Load()
em org.pdfclown.documents.contents.fonts.Font..ctor(PdfDirectObject baseObject)
em org.pdfclown.documents.contents.fonts.CompositeFont..ctor(PdfDirectObject baseObject)
em org.pdfclown.documents.contents.fonts.Type2Font..ctor(PdfDirectObject baseObject)
em org.pdfclown.documents.contents.fonts.Font.Wrap(PdfDirectObject baseObject)
em org.pdfclown.documents.contents.FontResources.Wrap(PdfDirectObject baseObject)
em org.pdfclown.documents.contents.ResourceItems`1.get_Item(PdfName key)
em org.pdfclown.documents.contents.objects.SetFont.GetResource(IContentContext context)
em org.pdfclown.documents.contents.objects.SetFont.GetFont(IContentContext context)
em org.pdfclown.documents.contents.objects.SetFont.Scan(GraphicsState state)
em org.pdfclown.documents.contents.ContentScanner.MoveNext()
em org.pdfclown.documents.contents.ContentScanner.TextWrapper.Extract(ContentScanner level)
em org.pdfclown.documents.contents.ContentScanner.TextWrapper..ctor(ContentScanner scanner)
em org.pdfclown.documents.contents.ContentScanner.GraphicsObjectWrapper.Get(ContentScanner scanner)
em org.pdfclown.documents.contents.ContentScanner.get_CurrentWrapper()

I'm using pdfclown version 0.1.2.0

The error happens on PDFs printed in Google Chrome (CRTL + P, print/save as PDF)

1 Attachments

Discussion

  • Stefano Chizzolini

    On composite font loading, glyph widths were wrongly cast to PdfInteger instead of generic numbers (real numbers are allowed, though normalized glyph width values are typically integers).

    Fixed on 0.1.2-Fix branch (rev 196) and 0.2.0 trunk (rev 197).

    You can get a fresh copy of the fixed library through the 0.1.2-Fix snapshot (sourceforge.net).

    thank you

     
  • Stefano Chizzolini

    • status: open --> closed-fixed
    • Priority: 6 --> 1
     

Log in to post a comment.

MongoDB Logo MongoDB