[
https://issues.apache.org/jira/browse/PDFBOX-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15390585#comment-15390585
]
Maruan Sahyoun commented on PDFBOX-3353:
----------------------------------------
good idea - maybe we should consider how an API of 'drawing' to a page or
appearance should look like if we would do it from scratch, work towards that
and look how we can have the current API still available for compatibility
purposes (and deprecate it for 3.x). The need to create an appearance stream
for annotations has not been well reflected in PDFBox so far. And I do share
your opinion that we should be selective in what is public and what not,
although we might come to a different result for specific methods classes.
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).
The main motivation for the changes I've done are:
- 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.
- I wanted to be able to replicate Adobe Acrobats behavior when creating the
annotations appearance stream. There are some specifics e.g. when setting the
color the color space CS operator is not printed. With the current
implementation of PDPageContentStream the CS operator has always been printed.
So there are some differences which I wanted to deal with without changing how
PDPageContentStream currently works
- I wanted a quick (and dirty?) way of being able to deal with generating
appearance streams (mainly because of interactive forms which I'm currently
working on) without introducing too many changes
- I didn't want to introduce new patterns like factory pattern or decorator
pattern
- I wanted to minimize the risk of breaking the current behavior as the set of
tests we have is limited
- 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.
> 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]