[
https://issues.apache.org/jira/browse/PDFBOX-3305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15230501#comment-15230501
]
John Hewson edited comment on PDFBOX-3305 at 4/7/16 4:31 PM:
-------------------------------------------------------------
{quote}
This is needed because otherwise there is no other way of setting a transform
matrix manually which might have skew/rotation in addition to
scaling/translation.
{quote}
Not so. Matrixes are concatenated, not replaced, so just apply the transform
you want before drawing the image. Then restore the graphics state afterwards.
{quote}
An alternative to this patch could also be a drawImage method which takes a
Matrix and applies it. But still if for whatever reasons multiple images should
be drawn with the same transformation matrix this would be inflexible.
{quote}
Images drawn with the same transformation matrix will appear at exactly the
same position. Each image really needs its own scaling and positioning matrix,
which is why we have it built-in.
was (Author: jahewson):
{quote}
This is needed because otherwise there is no other way of setting a transform
matrix manually which might have skew/rotation in addition to
scaling/translation.
{quote}
Not so. Matrixes are concatenated, not replaced, so just apply the transform
you want before drawing the image. Then restore the graphics state afterwards.
{quote}
An alternative to this patch could also be a drawImage method which takes a
Matrix and applies it. But still if for whatever reasons multiple images should
be drawn with the same transformation matrix this would be inflexible.
{quote}
Images drawn with the same transformation matrix will appear at exactly the
same position. Each image really needs its own matrix, which is why we have it
built-in.
> PDPageContentStream should allow drawing images at current position
> -------------------------------------------------------------------
>
> Key: PDFBOX-3305
> URL: https://issues.apache.org/jira/browse/PDFBOX-3305
> Project: PDFBox
> Issue Type: Improvement
> Components: PDModel
> Affects Versions: 2.0.0
> Reporter: Michele Balistreri
> Priority: Minor
> Attachments: pdpagecontentstream-drawimage.diff
>
>
> The PDPageContentStream class has two drawImage methods (one calling the
> other) but both add a transformation to the graphics state. This patch adds a
> drawImage method with a single parameter (the image), which only adds the
> image without applying any transformation.
> This is needed because otherwise there is no other way of setting a transform
> matrix manually which might have skew/rotation in addition to
> scaling/translation.
> An alternative to this patch could also be a drawImage method which takes a
> Matrix and applies it. But still if for whatever reasons multiple images
> should be drawn with the same transformation matrix this would be inflexible.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]