[ 
https://issues.apache.org/jira/browse/PDFBOX-909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeremias Maerki reopened PDFBOX-909:
------------------------------------


Andreas, are you sure these changes are right? Right now, I have a case 
reported to me by a client in which a Type1C font produces tons of exceptions 
at AffineTransform.createInverse() because the numberOfRowElements in PDMatrix 
was set to 2. This causes the wrong element to be fetched from the FontMatrix 
(0 instead of 0.001). As an experiment, I've added another constructor to 
PDMatrix which lets you set the number of columns explicitely:

    /**
     * Constructor.
     *
     * @param array The array that describes the matrix.
     * @param elementsPerRow the number of elements in a row of the matrix
     */
    public PDMatrix( COSArray array, int elementsPerRow )
    {
        this.matrix = array;
        this.numberOfRowElements = elementsPerRow;
    }

Setting the elementsPerRow to 3 (instead of 2) from PDFont and PDType1CFont 
solves the problem. I don't think it's a good idea to add implicit knowledge 
about the number of columns in PDMatrix. I'd rather use an explicit constructor 
parameter for each use case. That puts the knowledge where the matrix is 
created. I can fix it like that if you like.

> Add support for a 6 element matrix
> ----------------------------------
>
>                 Key: PDFBOX-909
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-909
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>    Affects Versions: 1.2.0, 1.2.1, 1.3.1
>            Reporter: Andreas Lehmkühler
>            Assignee: Andreas Lehmkühler
>             Fix For: 1.4.0
>
>
> The PDMatrix class only supports 3x3 matrices.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to