[
https://issues.apache.org/jira/browse/PDFBOX-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920604#comment-13920604
]
Maruan Sahyoun commented on PDFBOX-1960:
----------------------------------------
Hi John, a PDF Matrix and AffineTransform Matrix have some different
definitions. E.g. in AffineTransform the last row is static 1 0 0 in a PDF
matrix the last column is static 0 0 1. I haven’t looked at the code yet but
wanted to ensure that it’s clear that the results (individual numbers) can not
be taken directly but you have taken the differences into account when
inspecting/expecting the results.
In order to support the development which you assigned to me could you come up
with some unit tests for the Matrix operations? Other than showing that the
results of AffineTransform and Matrix differ I’m not sure I understand what the
expected result is.
> Matrix is wrong
> ---------------
>
> Key: PDFBOX-1960
> URL: https://issues.apache.org/jira/browse/PDFBOX-1960
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.8.4, 2.0.0
> Reporter: John Hewson
> Assignee: Maruan Sahyoun
> Priority: Critical
>
> I've been driven insane recently by trying to get pattern fills to render
> correctly. Patterns have their own matrix which is concatenated to the CTM
> and no matter how I applied the transformation, the results were wrong.
> It turns out that org.apache.pdfbox.util.Matrix is not behaving as expected,
> here's an example from a pattern I'm working on. I performed the same
> concatenation (i.e. multiplication) using our Matrix and Java's
> AffineTransform, the results are as follows:
> Java AffineTransform:
> [[2.0, 0.0, 1.251E-12], [-0.0, 2.0, 1684.0]] *
> [[0.6, 0.0, 302.6], [0.0, 0.6, 1091.38]] =
> [[0.6,0.0,0.0][0.0,0.6,0.0][605.21,2856.34,1.0]]
> PDFBox Matrix:
> [[2.0,-0.0,0.0][0.0,2.0,0.0][1.251E-12,1684.0,1.0]] *
> [[0.3,0.0,0.0][0.0,0.300007,0.0][302.60,586.17,1.0]] =
> [[0.6,0.0,0.0][0.0,0.6,0.0][302.6,1091.38,1.0]]
> I suggest that we remove Matrix and replace it with AffineTransform.
--
This message was sent by Atlassian JIRA
(v6.2#6252)