You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Peter Deter (JIRA)" <ji...@apache.org> on 2010/03/23 09:26:27 UTC

[jira] Created: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Last characters in a line overlap when a PDF is printed
-------------------------------------------------------

                 Key: PDFBOX-667
                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
             Project: PDFBox
          Issue Type: Bug
    Affects Versions: 1.0.0
            Reporter: Peter Deter


When printing a PDF every last character in a line overlaps it's leading character.
This problem appears in v1.0.0

Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849115#action_12849115 ] 

Andreas Lehmkühler commented on PDFBOX-667:
-------------------------------------------

Works fine with the current trunk (926714) on winXP with JDK1.6.18

@Peter: Can you rerun the test with the current trunk version?

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, raw.out.pdf, raw.out.win.pdf, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Peter Deter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849163#action_12849163 ] 

Peter Deter commented on PDFBOX-667:
------------------------------------

Well, I retried with the current trunk version on Linux (JDK 1.6). Unfortunately the Problem still occurs. 
Quite fishy that it worked just well with PDFBox 0.7.3.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, raw.out.pdf, raw.out.win.pdf, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Maruan Sahyoun (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849634#action_12849634 ] 

Maruan Sahyoun commented on PDFBOX-667:
---------------------------------------

The reason the last character is still misplaced is related to the fact that the character is drawn independently from the rest of the line already within the pdf i.e. it's a different object. The patch handled the fact that for the other lines the last character was output by PDFBox as a separate Object although it belonged to the same string in the PDF.

The PDF is defining Helvetica for rendering the text.  To which printer/driver are you printing? 

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Peter Deter (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Deter updated PDFBOX-667:
-------------------------------

    Attachment: out.ps
                raw.pdf

raw.pdf is the PDF file I'm printing, out.ps is what's actually printed

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Peter Deter (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Deter updated PDFBOX-667:
-------------------------------

    Attachment: out_patch.ps

By and large the patch fixes the problem. Enough to sate me.
However there still appears to be a problem with the last character on the document (see attached out_patch.ps) which is still misplaced slightly.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Maruan Sahyoun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maruan Sahyoun updated PDFBOX-667:
----------------------------------

    Attachment: raw.out.win.pdf
                raw.out.pdf

The document prints fine on Max and Linux using the latest trunk (see raw.out.pdf). On Windows a warning occurs and one line is missing from the output (see raw.out.win.pdf). In all cases there is no overlapping of chars.

Warning on Windows:

23.03.2010 11:52:50 org.apache.pdfbox.util.PDFStreamEngine processOperator
WARNUNG: java.lang.ArrayIndexOutOfBoundsException: 1
java.lang.ArrayIndexOutOfBoundsException: 1
	at sun.awt.windows.WPrinterJob.setTextColor(Unknown Source)
	at sun.awt.windows.WPathGraphics.drawString(Unknown Source)
	at sun.awt.windows.WPathGraphics.drawString(Unknown Source)
	at org.apache.pdfbox.pdmodel.font.PDSimpleFont.writeFont(PDSimpleFont.java:350)
	at org.apache.pdfbox.pdmodel.font.PDType1Font.drawString(PDType1Font.java:248)
	at org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.java:183)
	at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:494)
	at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:45)
	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:552)
	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:248)
	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:207)
	at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:106)
	at org.apache.pdfbox.pdmodel.PDPage.print(PDPage.java:801)
	at sun.print.RasterPrinterJob.printPage(Unknown Source)
	at sun.print.RasterPrinterJob.print(Unknown Source)
	at sun.print.RasterPrinterJob.print(Unknown Source)
	at org.apache.pdfbox.pdmodel.PDDocument.print(PDDocument.java:993)
	at PrintPDF.main(PrintPDF.java:128)

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, raw.out.pdf, raw.out.win.pdf, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-667.
---------------------------------------

    Fix Version/s: 1.3.0
       Resolution: Fixed

PDFBOX-828 solves this issue.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>             Fix For: 1.3.0
>
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf, raw_pagedraw.png
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864843#action_12864843 ] 

Andreas Lehmkühler commented on PDFBOX-667:
-------------------------------------------

Due to some sideeffects within textextraction (see PDFBOX-718) I've reverted the patch with version 941807.

We have to dig deeper into the textextraction part to see what's causing the sideeffect.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf, raw_pagedraw.png
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862107#action_12862107 ] 

Andreas Lehmkühler commented on PDFBOX-667:
-------------------------------------------

I've applied Maruans Patch with version 939208.

Thanks for the contribution.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf, raw_pagedraw.png
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Maruan Sahyoun (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maruan Sahyoun updated PDFBOX-667:
----------------------------------

    Attachment: PDFStreamEngine.patch

The misplacement of the last char in the line occured because the last char was printed individually although the COSString contained the complete line. The patch resolves that issue. Please review and apply if you see fit.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Villu Ruusmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Villu Ruusmann updated PDFBOX-667:
----------------------------------

    Attachment: raw_pagedraw.png

Maruan has correctly spotted that the current loop termination condition is wrong, but it is not the root cause of the problem.

The sample file raw.pdf uses external TrueType font "Helvetica". Unlike Acrobat Reader and other "native" PDF viewer programs, PDFBox does not have a built-in support for this font and uses "Arial-MT" instead. All in all this results in incorrect font metrics.

The good news is that PDFBOX-663 provides remedy here - the text is still drawn using "Arial" instead of "Helvetica", but the font metrics is correct. Please see the sample image "raw_pagedraw.png".

Peter, please check out the SVN trunk one more time (PDFBOX-663 was committed yesterday) and see if it solves your problem.

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf, raw_pagedraw.png
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848621#action_12848621 ] 

Andreas Lehmkühler commented on PDFBOX-667:
-------------------------------------------

Can you provide us with an example?

> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (PDFBOX-667) Last characters in a line overlap when a PDF is printed

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PDFBOX-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916593#action_12916593 ] 

Andreas Lehmkühler edited comment on PDFBOX-667 at 9/30/10 2:28 PM:
--------------------------------------------------------------------

PDFBOX-828 solves this issue. Text extraction, rendering and printing work fine.

      was (Author: lehmi):
    PDFBOX-828 solves this issue.
  
> Last characters in a line overlap when a PDF is printed
> -------------------------------------------------------
>
>                 Key: PDFBOX-667
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-667
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Peter Deter
>             Fix For: 1.3.0
>
>         Attachments: out.ps, out_patch.ps, PDFStreamEngine.patch, raw.out.pdf, raw.out.win.pdf, raw.pdf, raw_pagedraw.png
>
>
> When printing a PDF every last character in a line overlaps it's leading character.
> This problem appears in v1.0.0
> Printing the same PDF with v 0.7.3 works fine. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.