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

John Hewson commented on PDFBOX-3353:
-------------------------------------

{quote}
maybe we should consider how an API of 'drawing' to a page or appearance should 
look like if we would do it from scratch [...] The need to create an appearance 
stream for annotations has not been well reflected in PDFBox so far.
{quote}

:D :D :D

{quote}
Also when you look at the current state of implementation please keep in mind 
that this is work in progress. So some of the current protected methods might 
disappear (as others might be introduced).
{quote}

Maybe we should move this work to a branch, like I did with "no-awt". That 
allowed me to make aggressive changes and then merge when things were stable - 
it worked out really well. Plus it keeps the trunk compatible with 2.0 until we 
decide to merge. Would also make it easy to diff all the changes and get an 
overall view of this work. WDYT?

{quote}
Annotations have a kind of content stream, the appearance stream, but it's not 
the pages content stream but separate. So I think it introduces some clarity 
that the annotation doesn't use the PDPageContentStream to write to something 
which is not the content stream of that page.
{quote}

This is a funny one. Ignoring the constructors, there's not really anything 
"page" specific about PDPageContentStream, in fact it would probably have been 
named PDContentStream if this name wasn't already taken. So I think it's worth 
thinking about PDPageContentStream being the central place where content stream 
writing happens (future refactoring and renaming not withstanding).

Looking at it, bullet points 3,4,5 would probably be mitigated by making this 
code a branch.

{quote}
I wanted to keep the naming although PDxxxContentStream might better be called 
xxxDrawer as it doesn't represent the content stream or appearance stream but 
provides the ability to issue drawing etc. commands.
{quote}

Absolutely, this takes us back to your remark about what a good API would look 
like. One other thought is that I'd love too see a non-breaking API that we 
could introduce in 2.1 (or 2.whatever) but that's more of an added bonus.

Overall, I really like the plan here. :)

> 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, 2.1.0
>            Reporter: Tilman Hausherr
>              Labels: Annotations
>         Attachments: SquareAnnotations.pdf, showAnnotation.java
>
>
> 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.3.4#6332)

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

Reply via email to