https://bugs.documentfoundation.org/show_bug.cgi?id=174103
Bug ID: 174103
Summary: PDF export: spot color name with spaces written
unescaped in DeviceN colorants of embedded PDF image
(Acrobat Reader fails to open file)
Product: LibreOffice
Version: 26.2.6.3 release
Hardware: x86-64 (AMD64)
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Writer
Assignee: [email protected]
Reporter: [email protected]
Created attachment 209263
--> https://bugs.documentfoundation.org/attachment.cgi?id=209263&action=edit
Pliki z problemem
Problem description:
When a PDF graphic that uses a DeviceN color space with a spot color (here:
CMYK + "PANTONE 423 C", produced by CorelDRAW 2026) is placed in a Writer
document and the document is exported to PDF, the exported PDF contains the
spot color name with raw spaces:
/PANTONE 423 C
instead of the correctly escaped PDF name:
/PANTONE#20423#20C
Names in PDF must not contain whitespace, so the resulting file is
syntactically invalid. As a result:
- Adobe Acrobat Reader shows an error and does not open the file at all (the
whole document, not only the affected page).
- qpdf --check reports "unknown token while reading object; treating as string"
and "expected dictionary key but found non-name object" for the affected
objects.
- poppler (pdftoppm/pdfimages) reports "Bad DeviceN color space (names)" and
"Bad color space in shading dictionary".
- More tolerant viewers can still display the file.
The source PDF (attached, Poważnie.pdf) is valid and contains the properly
escaped name /PANTONE#20423#20C in its DeviceN /Colorants dictionary and in the
DeviceN names array. So the #20 escape seems to be decoded when the embedded
PDF is read, and is not re-encoded when the name is written to the exported
PDF.
Steps to Reproduce:
1. Take the attached Poważnie.pdf (single A5 page, created by CorelDRAW 2026 /
Corel PDF Engine 27.0.0.121, PDF 1.4; contains a photo in a DeviceN
CMYK+PANTONE 423 C color space and a gradient shading using the same spot
color).
2. Insert it into a Writer document as a graphic [TODO: exact method, e.g.
Insert > Image or Insert > Image > From file].
3. File > Export as PDF with default settings (PDF version in the exported file
is 2.0).
4. Open the exported file in Adobe Acrobat Reader, or run: qpdf --check
exported.pdf
Actual Results:
Acrobat Reader reports an error and does not open the file. qpdf and poppler
report the errors listed above. In the exported file the colorant name appears
as "/PANTONE 423 C" (see attached Problem.pdf, 3 pages exported from a larger
book; the affected objects are near the beginning of the file).
Expected Results:
The exported PDF is valid. Special characters in PDF names (here: space) are
written as #20 (i.e. /PANTONE#20423#20C), and the file opens in Acrobat Reader.
Workaround:
Binary-replacing "/PANTONE 423 C" with "/PANTONE#20423#20C" in the exported
file and letting qpdf rebuild the cross-reference table produces a file that
opens correctly. Exporting the graphic from CorelDRAW without spot colors (pure
CMYK) should also avoid the problem.
Reproducible: Always (with these files)
Attachments:
- Poważnie.pdf: source graphic (valid)
- Problem.pdf: 3 pages exported from LibreOffice (invalid)
- [optional] a minimal .odt containing only the graphic
Version: 26.2.6.3 (X86_64)
Build ID: 8221e31b3ac356a1623c672912a3d2b492f7e3d1
CPU threads: 20; OS: Windows 11 X86_64 (build 26300); UI render: Skia/Raster;
VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.