unipdf
unipdf copied to clipboard
[BUG] Rendering error: unexpected subtable format: 6
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:
- 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
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.
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
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.