xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Tošovský (JIRA) <j...@apache.org>
Subject [jira] [Updated] (FOP-2502) [PATCH] Rendering dashed lines with zero length components
Date Fri, 13 Jul 2018 20:21:00 GMT

     [ https://issues.apache.org/jira/browse/FOP-2502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jan Tošovský updated FOP-2502:
------------------------------
    Attachment: FOP-2502.patch
       Summary: [PATCH] Rendering dashed lines with zero length components  (was: Rendering
dashed lines with zero length components)

> [PATCH] Rendering dashed lines with zero length components
> ----------------------------------------------------------
>
>                 Key: FOP-2502
>                 URL: https://issues.apache.org/jira/browse/FOP-2502
>             Project: FOP
>          Issue Type: Improvement
>          Components: renderer/pdf
>    Affects Versions: trunk
>            Reporter: Jan Tošovský
>            Priority: Minor
>         Attachments: FOP-2502.patch
>
>
> The current PDF renderer may produce following dashed line segments:
> {code}[0 0] 0 d{code}
> This combination puzzles Adobe Reader which stops rendering the remaining content.
> I suggest avoiding this combination by a simple check in setDashLine() method in PDFGraphicsPainter.java:
> {code}
>         public PDFContentGeneratorHelper setDashLine(float first, float... rest) {
>             StringBuilder sb = new StringBuilder(format(first));
>             for (float unit : rest) {
>                 sb.append(" ").append(format(unit));
>             }
>             if (sb.toString().equals("0 0")) {
>                 sb = new StringBuilder();
>             }
>             sb.insert(0, "[");
>             sb.append("] 0 d ");
>             
>             generator.add(sb.toString());
>             return this;
>         }
> {code}
> The code above produces the following code instead, which is Ok.
> {code}[] 0 d{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message