[reportlab-users] Best practices for adding bleed with crop marks?

Stevens, Ian IStevens at globeandmail.com
Fri Feb 15 17:50:15 EST 2008


In order to send PDFs to a printer, I had to add a bleed margin of 1/8".
I went in the following direction and am wondering if there was a better
way:

- Overload BaseDocTemplate with an optional bleed parameter in its
constructor, which stores it in the object
- Overload BaseDocTemplate.build() to:
- Increase the pagesize by twice the bleed amount
- Create copies of any pageTemplates and offset any frames therein
by the bleed amount.
- Any frames right on the edge of the page are assumed to contain
colour content which may bleed, so those frames are widened by the bleed
amount, not offset
- Call BaseDocTemplate.build()
- Restore the BaseDocTemplate pageTemplates, pagesize and frames to
their original state
- Overload BaseDocTemplate.handlePageEnd() to draw crop marks

Any templates overloading the above new class are responsible for:

- Offsetting any objects drawn directly on the canvas by the bleed
amount
- Adjusting the width/height of any objects drawn directly on the canvas
which extend to the edge.
- Widening/padding any flowables which are added to frames on the edge
of the page. (eg. increasing the width of a table with a colour
background lying on the page edge by the bleed amount.)

It's not a perfect solution and I'm wondering if it could have been
better implemented, possibly with less work from those overloading the
new BaseDocTemplate. Any input would be appreciated.

thanks,
Ian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20080215/248f0cbb/attachment.html>


More information about the reportlab-users mailing list