unipdf icon indicating copy to clipboard operation
unipdf copied to clipboard

[BUG] Rendering error: unexpected subtable format: 6

Open gunnsth opened this issue 4 years ago • 1 comments

Description

An error occurs when rendering the attached file. Not sure what subtable is being referred to, probably either in the image format or the font.

Expected Behavior

Render the pdf page as an image.

Actual Behavior

Steps to reproduce the behavior:

  1. Run the rendering example on the attached file
./pdf_image_render out ZGTA198001028.pdf

Attachments

Include a self-contained reproducible code snippet and PDF file that demonstrates the issue. ZGTA198001028.pdf

gunnsth avatar Jan 22 '20 19:01 gunnsth

So I looked into this a little bit. The subtable is referring to the subtable in the cmap table of the embedded font (pdf object 10). The embedded font in the attached PDF has a subtable with the following fields:

Platform ID: 3 (Windows) Encoding ID: 1 Format: 6

But according to the Windows spec, Platform ID 3 and Encoding ID 1 should have format 4, which UniPDF checks for and why it returns "unexpected subtable 6" as an error.

image Source: https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#use-of-the-language-field-in-cmap-subtables

PDF readers are still able to read the file despite that just fine though, so I'm not sure how UniPDF should handle this file

ZavierHenry avatar Jul 29 '20 06:07 ZavierHenry

Released new UniPDF version to solve the issue with subtable format: 6. https://github.com/unidoc/unipdf/releases/tag/v3.51.0

Closing this issue for now.

sampila avatar Oct 09 '23 11:10 sampila