You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/03/05 20:26:43 UTC

[jira] [Commented] (PDFBOX-1094) Pattern colorspace support

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

John Hewson commented on PDFBOX-1094:
-------------------------------------

I'm still having problems implementing patterns as AWT Paint. I've got a solution for the pixelation problem, but I still can't draw the patterns with the correct offsets on the page. The issue is that when a pattern is drawn it is not drawn with its origin at the current (x,y) coordinate and using the current CTM, rather it is drawn with its origin at the current stream's initial (x,y) coordinate and using the stream's initial CTM, from the PDF spec:

{quote}
Every pattern has a  pattern matrix, a transformation matrix that maps the pattern’s internal coordinate system to the default  coordinate system of the pattern’s parent content stream (the content stream in which the pattern is defined as a resource).
{quote}

So the current CTM is ignored, which is confirmed by:

{quote}
Changes to the page’s transformation matrix that occur within the page’s content stream, such as rotation and  scaling, have no effect on the pattern; it maintains its original relationship to the page no matter where on the  page it is used.
{quote}

Conceptually, the pattern is drawn over the entire page at the very beginning and when we fill a shape with a pattern we are filling it with a "window" through to the pattern which covers the page (that's not actually what happens but it helps to think that way to understand).

As far as I can tell there is no way to pass the stream's initial CTM to our AWT Paint object.

> Pattern colorspace support
> --------------------------
>
>                 Key: PDFBOX-1094
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1094
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 1.6.0
>            Reporter: Andreas Lehmkühler
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>         Attachments: ColoredTilingPaint.patch, PATTYP1.pdf, PATTYP2.pdf, PDF32000_2008_pg737.pdf, PDFStreamEngine.patch, PageDrawer.patch, _pdfbox-1094-tiling_pattern.pdf-1-blurry.png, jagpdf_doc_patterns.pdf, jagpdf_doc_patterns.pdf-1.png, pdfbox-1094-pdf32000_2008_pg737.pdf-1.png, pdfbox-1094-pdf32000_2008_pg737.pdf-1.png, pdfbox-1094-tiling_pattern.pdf-1.png, pdfbox-1094-tiling_pattern.pdf-1.png, pdfbox-1094-tiling_pattern.pdf-1.png, pdfbox-1861-tracemonkey.pdf-13.png, pdfbox-1861-tracemonkey.pdf-13.png, tiling_pattern.pdf
>
>
> PDFBox doesn't support PDPattern colorspaces



--
This message was sent by Atlassian JIRA
(v6.2#6252)