Hi All

I’m still working on getting Tiling Patterns to render correctly, and need to 
make some
changes to core PDFBox functionality in order to proceed. My problem is that 
tiling
patterns are defined in their parent stream’s initial coordinate space, rather 
than the
coordinate space defined by the CTM. However, in PDFBox there is no way to 
access
the parent stream, so I can’t find out what it’s initial matrix is. The manner 
in which the
initial coordinate space is determined is different for pages, forms, and 
patterns

What this means is that the parent stream’s initial coordinate space needs to 
be passed
to processStream and processSubStream in PDFStreamEngine. This will necessarily 
be
a breaking change, and it will affect all downstream subclasses of 
PDFStreamEngine.

Because this has to be a breaking change, I propose that we go all the way and 
make
the new API bulletproof, 1) so that we won’t have to introduce breaking changes 
in the
future if we encounter similar issues, 2) so that the caller of the method 
can’t pass the
wrong data in the parameters. We would remove the two generic methods:

public void processStream(PDResources resources, COSStream cosStream, 
PDRectangle drawingSize, int rotation)
public void processSubStream(PDResources resources, COSStream cosStream)

and replace them with four specific methods:

public void processPage(PDPage page)
public void processForm(PDFormXObject form)
public void processTilingPattern(PDTilingPattern pattern)
public void processType3Font(PDType3Font font)

This would mean that the various “procesXXXX” methods have access to their 
parent
stream, and can read any of its public fields in the future without introducing 
breaking
changes by altering the method’s parameters.

What do you think?

-- John

Reply via email to