[
https://issues.apache.org/jira/browse/PDFBOX-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16142973#comment-16142973
]
chitgoks edited comment on PDFBOX-3353 at 8/27/17 1:10 AM:
-----------------------------------------------------------
Hi Tilman, ok, so i removed the cs.getResources() and no more errors show up
during compile. but after generation nothing shows up.
i thought that it may be because of my apperance stream's bounding box since
all were 0,0,1,1 and i focused the correct values with the quad points. but
even after i set the values based on acrobat's generated values after i resaved
the pdf, no highlight gets shown.
the same happens with underline and strikeout. could it be something with the
resources?
this is my code to get the bounding box of quad points.
{code:java}
public static PDRectangle getBoundingBoxOfQuadPoints(float[] quadPoints) {
float minX = Float.MAX_VALUE;
float minY = Float.MAX_VALUE;
float maxX = Float.MIN_VALUE;
float maxY = Float.MIN_VALUE;
for (int i=0; i<quadPoints.length; i+=8) {
float ax = quadPoints[i + 4];
float ay = quadPoints[i + 5];
float bx = quadPoints[i + 2] - ax;
float by = quadPoints[i + 3] - ay;
minX = Math.min(ax, minX);
minY = Math.min(ay, minY);
maxX = Math.max(bx, maxX);
maxY = Math.max(by, maxY);
}
return new PDRectangle(minX, minY, maxX - minX, maxY - minY);
}
{code}
was (Author: chitgoks):
Hi Tilman, ok, so i removed the cs.getResources() and no more errors show up
during compile. but after generation nothing shows up.
i thought that it may be because of my apperance stream's bounding box since
all were 0,0,1,1 and i focused the correct values with the quad points. but
even after i set the values based on acrobat's generated values after i resaved
the pdf, no highlight gets shown.
the same happens with underline and strikeout. could it be something with the
resources?
> 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
> Reporter: Tilman Hausherr
> Labels: Annotations
> Attachments: line_dimension_appearance_stream-noAP.pdf,
> line_dimension_appearance_stream.pdf,
> PDFBOX-3353-highlight-noAP-001796-p1.pdf, PDFBOX-3353-highlight-noAP.pdf,
> showAnnotation-2.java, showAnnotation.java, SquareAnnotations.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: [email protected]
For additional commands, e-mail: [email protected]