mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-22 00:04:14 +02:00
fix
This commit is contained in:
+10
-6
@@ -492,13 +492,17 @@ void convertComponentInfoAnnotations(const QString &pdfPath,
|
|||||||
|
|
||||||
QByteArray contents = annotations[annotIndex].contents.toUtf8();
|
QByteArray contents = annotations[annotIndex].contents.toUtf8();
|
||||||
|
|
||||||
// Replace /Subtype /Link with /Subtype /Text, bounded to current object.
|
// Replace /Subtype /Link with /Subtype /Text, bounded to the enclosing
|
||||||
// Search only the bytes we just appended (the current annotation header).
|
// PDF object. Anchoring to " 0 obj" prevents hitting /Subtype /Link
|
||||||
int searchStart = out.size() - (aDictOpen - pos);
|
// from a cross-ref annotation that sits between the previous marker
|
||||||
int subTypePos = out.indexOf("/Subtype /Link", searchStart);
|
// and the current annotation on the same page.
|
||||||
if (subTypePos != -1) {
|
int objStart = body.lastIndexOf(" 0 obj", aDictOpen);
|
||||||
|
int subTypeInBody = (objStart != -1)
|
||||||
|
? body.indexOf("/Subtype /Link", objStart) : -1;
|
||||||
|
int subTypePos = (subTypeInBody != -1 && subTypeInBody < aDictOpen)
|
||||||
|
? out.size() - (aDictOpen - subTypeInBody) : -1;
|
||||||
|
if (subTypePos != -1)
|
||||||
out.replace(subTypePos, 14, "/Subtype /Text");
|
out.replace(subTypePos, 14, "/Subtype /Text");
|
||||||
}
|
|
||||||
|
|
||||||
// Encode as UTF-16BE hex with BOM for proper Unicode support (Umlauten etc.).
|
// Encode as UTF-16BE hex with BOM for proper Unicode support (Umlauten etc.).
|
||||||
// PDF spec: hex strings starting with FE FF are interpreted as UTF-16BE.
|
// PDF spec: hex strings starting with FE FF are interpreted as UTF-16BE.
|
||||||
|
|||||||
Reference in New Issue
Block a user