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

chitgoks commented on PDFBOX-3353:
----------------------------------

hi all. i deleted my comments and unnecessary uploaded files. apologies.

for the the recalculation of the coordinates, that was the solution as nothing 
in the appearance stream code needs to be modified except for

free text. 
-the rectangle is recalculated but when the appearance stream text is drawn, it 
is pointing upwards. this is for 270 degrees. what i did was in the content 
stream, rotate the matrix in order for the text to be drawn correctly.

cs.transform(Matrix.getRotateInstance(Math.toRadians(rotation), 0, 0));
cs.transform(Matrix.getTranslateInstance(-bbox.getHeight(), 0));

then text position is
cs.newLineAtOffset(0, annotation.getRectangle().getHeight());

[~tilman] for text markup, highlight underline and strike-through, the 
appearance stream code does not draw correctly at 270 degrees page rotation. my 
quad rectangles are correct since the outline when selected in acrobat shows 
correctly. it's the highlight fill and underline/strike through not drawn 
right. the code is especially for highlight are raw commands so i have no clue 
what they mean.

> Create appearance streams for annotations
> -----------------------------------------
>
>                 Key: PDFBOX-3353
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3353
>             Project: PDFBox
>          Issue Type: Task
>          Components: PDModel, Rendering
>    Affects Versions: 1.8.12, 2.0.0, 2.0.1, 2.0.2, 3.0.0 PDFBox
>            Reporter: Tilman Hausherr
>              Labels: Annotations
>         Attachments: PDFBOX-3353-highlight-noAP-001796-p1.pdf, 
> PDFBOX-3353-highlight-noAP.pdf, ShowAnnotation-4.java, SquareAnnotations.pdf, 
> line_dimension_appearance_stream-noAP.pdf, 
> line_dimension_appearance_stream.pdf, result-NoAP.pdf, result.pdf, 
> result_layout.png, showAnnotation.java, text_markup_ap_test.pdf
>
>
> Create appearance streams for annotations when missing.
> I'll start by replacing current code for Ink and Link annotations.
> Good example PDFs:
> http://www.pdfill.com/example/pdf_commenting_new.pdf
> https://github.com/mozilla/pdf.js/issues/6810



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to