[
https://issues.apache.org/jira/browse/PDFBOX-5430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533258#comment-17533258
]
Tilman Hausherr commented on PDFBOX-5430:
-----------------------------------------
Yes but this is weird - this is an invoice. Why would anybody do this with
Adobe Illustrator?
My guess is that the invoice template was created with AI, and then the invoice
data was added by some buggy billing software.
This is the raw 4th content stream (formatting like this in the original):
{noformat}
BT
64 477 Td
[/F3 8 Tf
(Monatliche Kosten ) Tj
/F1 8 Tf
0 -11 Td
] TJ
ET
{noformat}
the correct content stream would have been
{noformat}
BT
64 477 Td
/F3 8 Tf
(Monatliche Kosten ) Tj
/F1 8 Tf
0 -11 Td
ET
{noformat}
> PDFStreamEngine.showTextStrings with font switch
> ------------------------------------------------
>
> Key: PDFBOX-5430
> URL: https://issues.apache.org/jira/browse/PDFBOX-5430
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.26
> Reporter: Oliver Schmidtmer
> Priority: Major
> Attachments: keine Vorschau ELO-1228188_20220228_11462_HD_online.pdf
>
>
> The attached PDF fails to render with an PDFStreamEngine.showTextStrings with
> the following exception:
> "java.io.IOException: Unknown type COSName in array for TJ
> operation:COSName\{F3}"
> This seems to be a font switch.
> {code:java}
> diff --git
> "a/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java"
> "b/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java"
> index e4f2259a5..12edadd2b 100644
> ---
> "a/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java"
> +++
> "b/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java"
> @@ -680,6 +680,18 @@ public abstract class PDFStreamEngine
> byte[] string = ((COSString)obj).getBytes();
> showText(string);
> }
> + else if (obj instanceof COSName)
> + {
> + if(((COSName) obj).getName().startsWith("F"))
> + {
> + textState.setFont(resources.getFont((COSName) obj));
> + }
> + else
> + {
> + throw new IOException("Unknown type " +
> obj.getClass().getSimpleName()
> + + " in array for TJ operation:" + obj);
> + }
> + }
> else if (obj instanceof COSArray)
> {
> LOG.error("Nested arrays are not allowed in an array for TJ
> operation:" + obj);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]