[ 
https://issues.apache.org/jira/browse/PDFBOX-3616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15724182#comment-15724182
 ] 

Roman edited comment on PDFBOX-3616 at 12/6/16 5:23 AM:
--------------------------------------------------------

[~tilman] On your screenshot only 
[CropBox|https://wiki.scribus.net/canvas/PDF_Boxes_:_mediabox,_cropbox,_bleedbox,_trimbox,_artbox]
 of the document is shown. Our application works fine in this mode too. Also, 
we have the code dealing with scaling of type 3 fonts, I've cut it from snippet 
because the issue is not related to specific fonts at all.
Seems it is related somehow to in page boxes of the document (CropBox, 
MediaBox, etc..), and the issue is only on the first page of the document.
Also, note that on the first page different fonts (or at least sizes) used. 
But, all glyphs are shifted top by the same amount, which equals to nearly 8 or 
9.

I've attached full document: [^00051-2a7-00052-2a7.pdf]

P.S. We actually required to use glyph boxes which correspond to blue ones on 
your screenshot (but not cyan). This is because our highlightings required to 
be similar to text selection in Adobe Reader. In CropBox mode, our software 
works exactly as blue boxes on your screenshot. But have you a code that can 
render full MediaBox with correct blue boxes?

When a browser displays full Media Box, there is some extra space used to 
display it. Our current code takes this into account by adding this space as 
shown below. It works fine mostly on all docs, but the only issue with the 
first page of attached sample.

{code}
if (!useCropBox) {
    float dx =  pdPage.findMediaBox().getLowerLeftX() - 
pdPage.findCropBox().getLowerLeftX()
    float dy =  pdPage.findMediaBox().getLowerLeftН() - 
pdPage.findCropBox().getLowerLeftY()

    shift(dx, dy);//adds dx and dy values to ALL coordinates
}
{code}


was (Author: rmakarov):
[~tilman] On your screenshot only 
[CropBox|https://wiki.scribus.net/canvas/PDF_Boxes_:_mediabox,_cropbox,_bleedbox,_trimbox,_artbox]
 of the document is shown. Our application works fine in this mode too. Also, 
we have the code dealing with scaling of type 3 fonts, I've cut it from snippet 
because the issue is not related to specific fonts at all.
Seems it is related somehow to in page boxes of the document (CropBox, 
MediaBox, etc..), and the issue is only on the first page of the document.
Also, note that on the first page different fonts (or at least sizes) used. 
But, all glyphs are shifted top by the same amount, which equals to nearly 8 or 
9.

I've attached full document: [^00051-2a7-00052-2a7.pdf]

P.S. We actually required to use glyph boxes which correspond to blue ones on 
your screenshot (but not cyan). In CropBox mode, our software works exactly as 
blue boxes on your screenshot. But have you a code that can render full 
MediaBox with correct blue boxes?

> Characters shifted up
> ---------------------
>
>                 Key: PDFBOX-3616
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3616
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Roman
>              Labels: how-to
>         Attachments: 00051-2a7-00052-2a7.pdf, 
> 00051-2a7-00052-2a7.pdf_page0.pdf, PDFBOX-3616-marked-1.png, screenshot-1.png
>
>
> We have tried this on both 1.8.12 and 2.0.3 versions and got the same result 
> - character positions are shifted up. 
> We are assuming X and Y positions are relative to CropBox. 
> See [^screenshot-1.png], yellow highlights are upper than the texts.
> PDF doc is attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to