You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Keiron Liddle <ke...@aftexsw.com> on 2002/07/02 09:04:42 UTC

[REDESIGN] pdf changes

Hi All,

I have made some changes to the pdf library:

- added transparency for shapes and alpha mask for images
This is mainly for svg graphics but it can also apply to images such as
transparent png images (if someone wants to implement this feel free :).

- made pdf lib independant
The pdf stuff does not refer to other FOP specific classes such as
configuration and FopImage. This makes it easier to use and prevents
generic FOP classes from having pdf specific code in them.

- Outputs pdf objects immediately
If an image is added to the pdf document then it can be streamed out
immediately and the memory released.
Care needs to be taken that objects are not added until they are ready
to be streamed out.
This saves quite a bit of memory when drawing images, the image data can
be released completely.

- adds resources to a context
This is important for patterns where the resources inside the pattern
cannot be added to the document resources.

Unfortunately I have broken the xref table and I can't figure out what
is wrong.

It needs improvement with the gstate dictionaries and testing to ensure
objects are not added too early.

Keiron.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


AW: AW: [REDESIGN] pdf changes

Posted by "J.U. Anderegg" <ha...@bluewin.ch>.
XREF

PDF objects have to be written PHYSICALLY in ascending sequence of the PDF
object ID's. This is a requirement of the present XREF handling. If tis
condition is fulfilled and PDF syntax is correct, there is most likely a
length in error.


Page viewport in PDF is the /Cropbox

Cropbox:
x = left page marging
y = bottom page margin
width = page size - left margin - right margin
height = page height - top margin - bottom margin

o The page margins have to be passed to the renderer.
o Coordinates are relative to the crop box (to be checked): the renderer has
to adjust.

Hansuli Anderegg, Zurich



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: AW: [REDESIGN] pdf changes

Posted by Keiron Liddle <ke...@aftexsw.com>.
On Tue, 2002-07-02 at 11:48, J.U. Anderegg wrote:
> Keiron wrote:
> 
> >- added transparency for shapes and alpha mask for images
> 
> well, what has to be transparent? Background images or overlaying text?
> - 82 pages: Transparency in PDF, Technical Note #5407, Adobe Developer
> Technologies

xsl:fo does not currently support alpha in colours so it does not apply
for normal text or borders.
An image could contain an alpha mask and there could be a background
colour below the image.
Any svg object could have an alpha value or a transparency alpha image
mask.

> >- Outputs pdf objects immediately
> >Unortunately I have broken the xref table and I can't figure out what is
> wrong.
> 
> The XREF is built incrementally in parallel to file writing. So your PDF
> object has to wait, until it is it's turn to output to the file.

The objects can be output to the pdf in any order, the xref simply gives
the offset of each object in the correct order (1..n). The reader uses
the xref to locate an object (the trailer contains the root and info
object numbers).

> Example: image xObject on page in PDFRenderer
> 
> - create xObject: say PDF object ID 27
> - add xObject to page objects
> - output page objects: method "toPDF" of objects say 20-30 is invoked
> 	. object 27: do the data/processing intensive things at this time
> 
> If you send me the code, I can figure out what the problem is.

The code is in cvs. It was working before but something has gone wrong
:(

> Hansuli Anderegg, Zurich



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


AW: [REDESIGN] pdf changes

Posted by "J.U. Anderegg" <ha...@bluewin.ch>.
Keiron wrote:

>- added transparency for shapes and alpha mask for images

well, what has to be transparent? Background images or overlaying text?
- 82 pages: Transparency in PDF, Technical Note #5407, Adobe Developer
Technologies

>- Outputs pdf objects immediately
>Unortunately I have broken the xref table and I can't figure out what is
wrong.

The XREF is built incrementally in parallel to file writing. So your PDF
object has to wait, until it is it's turn to output to the file.

Example: image xObject on page in PDFRenderer

- create xObject: say PDF object ID 27
- add xObject to page objects
- output page objects: method "toPDF" of objects say 20-30 is invoked
	. object 27: do the data/processing intensive things at this time

If you send me the code, I can figure out what the problem is.

Hansuli Anderegg, Zurich



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org