View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0013241 | Scribus | public | 2015-07-18 05:05 | 2015-11-22 13:56 | |
| Reporter | william | Assigned To | jghali | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | x86_64 | OS | Fedora Linux | OS Version | 20 |
| Product Version | 1.5.0 | ||||
| Fixed in Version | 1.5.1svn | ||||
| Summary | 0013241: Scribus 1.5.1 writes invalid PDF hex strings | ||||
| Description | PDF hex strings should contain only hex (0-9, A-F, a-f). When Scribus writes long hex strings, it wraps them with a backslash and newline. When poppler-based utilities read the PDF, they report warnings like the one below. Hex 5C = decimal 92 = the ascii code for a backslash. Syntax Error (483): Illegal character <5c> in hex string When ghostscript pdf2ps reads the PDF, it aborts with **** Error reading a content stream. The page may be incomplete. | ||||
| Steps To Reproduce | To reproduce the error, open a document in Scribus 1.5.1 and use File -> Document Setup -> Document Information change the Title to something long (over 80 characters), then use File -> Export -> Save as PDF | ||||
| Additional Information | Here is what happens: scribus/pdflib_core.cpp PDFLibCore::PDF_Begin_MetadataAndEncrypt() runs if ((PDF_IsPDFX()) && (docTitle.isEmpty())) PutDoc("/Title " + EncStringUTF16(doc.DocName, writer.InfoObj) + "\n"); else PutDoc("/Title " + EncStringUTF16(doc.documentInfo().title(), writer.InfoObj) + "\n"); scribus/pdflib_core.cpp PDFLibCore::EncStringUTF16() runs Pdf::toHexString(writer.encryptBytes(us, ObjNum)); (Scribus 1.4 uses "<"+String2Hex(&uk, false)+">" which writes straight hex with no \ or nl) scribus/pdfwriter.cpp toHexString(QByteArray s) runs if (i % linelength == linelength-1) result.append("\\\n"); | ||||
| Tags | No tags attached. | ||||
| Attached Files | scribus15-hex-20150718-004651.patch (537 bytes)
--- scribus15/scribus/pdfwriter.cpp- 2015-06-17 14:44:43.948020830 -0400
+++ scribus15/scribus/pdfwriter.cpp 2015-07-17 21:42:49.212222391 -0400
@@ -339,15 +339,12 @@
QByteArray toHexString(QByteArray s)
{
- int linelength = 80;
QByteArray result("<");
for (int i = 0; i < s.length(); ++i)
{
uchar v = s[i];
result.append("0123456789ABCDEF"[v / 16]);
result.append("0123456789ABCDEF"[v % 16]);
- if (i % linelength == linelength-1)
- result.append("\\\n");
}
result.append(">");
return result;
scribus15-hex-20150718-012506.patch (399 bytes)
--- scribus15/scribus/pdfwriter.cpp- 2015-06-17 14:44:43.948020830 -0400
+++ scribus15/scribus/pdfwriter.cpp 2015-07-18 01:21:52.532662287 -0400
@@ -347,7 +347,7 @@
result.append("0123456789ABCDEF"[v / 16]);
result.append("0123456789ABCDEF"[v % 16]);
if (i % linelength == linelength-1)
- result.append("\\\n");
+ result.append("\n");
}
result.append(">");
return result;
| ||||
| Patch | Yes | ||||
|
|
The attached titletest.sla is a Scribus 1.5.1 document with a long title that shows the problem when you export it to PDF. |
|
|
The second patch scribus15-hex-20150718-012506.patch only changes the backslash+nl to a nl. |
|
|
Great report. Thanks for submitting! :) |
|
|
Patch applied, thanks! |
|
|
Patch applied in r20262. Thanks William and Jghali! |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2015-07-18 05:05 | william | New Issue | |
| 2015-07-18 05:05 | william | File Added: scribus15-hex-20150718-004651.patch | |
| 2015-07-18 05:05 | william | File Added: titletest.sla | |
| 2015-07-18 05:06 | william | Note Added: 0035825 | |
| 2015-07-18 05:26 | william | File Added: scribus15-hex-20150718-012506.patch | |
| 2015-07-18 05:28 | william | Note Added: 0035826 | |
| 2015-07-18 13:45 | Kunda | Note Added: 0035828 | |
| 2015-07-18 18:47 | jghali | Note Added: 0035839 | |
| 2015-07-18 18:47 | jghali | Status | new => resolved |
| 2015-07-18 18:47 | jghali | Fixed in Version | => 1.5.1svn |
| 2015-07-18 18:47 | jghali | Resolution | open => fixed |
| 2015-07-18 18:47 | jghali | Assigned To | => jghali |
| 2015-07-22 15:24 | Kunda | Note Added: 0035860 | |
| 2015-07-22 15:24 | Kunda | Status | resolved => closed |
| 2015-11-22 13:56 | jghali | Summary | [patch] Scribus 1.5.1 writes invalid PDF hex strings => Scribus 1.5.1 writes invalid PDF hex strings |