[reportlab-users] reportlab-users Digest, Vol 39, Issue 1

kevin kevin at booksys.com
Mon Oct 1 12:11:55 EDT 2007


Yes, my example was a bad one. I realized immediately that my example
was bad. The avery site will let you generate a PDF with mailing labels
(got this clue from some Ruby developers). The resultant PDF
automatically pops up the print dialog and the page scaling is already
set to none. This is what I'd love to do, as I can't expect the users to
continually remember to set this. I'll see if I can hunt down where the
pdf was generated. I am attaching the pdf I generated from their site.

Thanks!

kevin at booksys.com

reportlab-users-request at reportlab.com wrote:

> Send reportlab-users mailing list submissions to

> reportlab-users at reportlab.com

>

> To subscribe or unsubscribe via the World Wide Web, visit

> http://two.pairlist.net/mailman/listinfo/reportlab-users

> or, via email, send a message with subject or body 'help' to

> reportlab-users-request at reportlab.com

>

> You can reach the person managing the list at

> reportlab-users-owner at reportlab.com

>

> When replying, please edit your Subject line so it is more specific

> than "Re: Contents of reportlab-users digest..."

>

>

> Today's Topics:

>

> 1. Problem on Mac OSX (Y Tu)

> 2. Automatically set Page Scaling and Print? (kevin)

> 3. Re: Automatically set Page Scaling and Print? (Andy Robinson)

> 4. Re: Automatically set Page Scaling and Print? (Robin Becker)

>

>

> ----------------------------------------------------------------------

>

> Message: 1

> Date: Mon, 1 Oct 2007 08:45:04 -0500

> From: Y Tu <ytu888 at hotmail.com>

> Subject: [reportlab-users] Problem on Mac OSX

> To: <reportlab-users at reportlab.com>

> Message-ID: <BAY119-W3252F371EC46E8BE47BB098FAD0 at phx.gbl>

> Content-Type: text/plain; charset="iso-8859-1"

>

>

>

> I installed PIL and ReportLab on Mac OS X. The test-run with command "from PIL import Image" followed by "import _imaging", and "from reportlab.graphics import renderPDF" succeeded. However, when I run the test script (eportlab/test/test_pdfgen_general.py) coming with the package, I got the following error. How to fix the problem. Another question is how to run the script under the python prompt (>>>) after importing the scirpt by "import test_pdfgen_general.py". Thank yuo very much.

>

>

> nypivs-lee:/Applications/MacPython 2.5/reportlab/test lee$ python test_pdfgen_general.py

> E

> ======================================================================

> ERROR: Make a PDFgen document with most graphics features

> ----------------------------------------------------------------------

> Traceback (most recent call last):

> File "test_pdfgen_general.py", line 833, in test0

> run(outputfile('test_pdfgen_general.pdf'))

> File "test_pdfgen_general.py", line 796, in run

> c = makeDocument(filename)

> File "test_pdfgen_general.py", line 725, in makeDocument

> c.drawImage(tgif, 4*inch, 9.25*inch, w, h, mask='auto')

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfgen/canvas.py", line 629, in drawImage

> imgObj = pdfdoc.PDFImageXObject(name, image, mask=mask)

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py", line 1840, in __init__

> self.loadImageFromA85(src)

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py", line 1846, in loadImageFromA85

> imagedata = map(string.strip,pdfutils.makeA85Image(source,IMG=IMG))

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/pdfbase/pdfutils.py", line 35, in makeA85Image

> raw = img.getRGBData()

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/reportlab/lib/utils.py", line 612, in getRGBData

> self._data = im.tostring()

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/Image.py", line 513, in tostring

> self.load()

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/ImageFile.py", line 180, in load

> d = Image._getdecoder(self.mode, d, a, self.decoderconfig)

> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/PIL/Image.py", line 375, in _getdecoder

> raise IOError("decoder %s not available" % decoder_name)

> IOError: decoder jpeg not available

>

> ----------------------------------------------------------------------

> Ran 1 test in 0.321s

>

> FAILED (errors=1)

>

> _________________________________________________________________

> Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!

> http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

> -------------- next part --------------

> An HTML attachment was scrubbed...

> URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071001/e7d0a4b1/attachment-0001.html>

>

> ------------------------------

>

> Message: 2

> Date: Mon, 01 Oct 2007 09:55:14 -0500

> From: kevin <kevin at booksys.com>

> Subject: [reportlab-users] Automatically set Page Scaling and Print?

> To: reportlab-users at reportlab.com

> Message-ID: <47010A52.1070901 at booksys.com>

> Content-Type: text/plain; charset=ISO-8859-1; format=flowed

>

> Hi all,

>

> We use reportlab to generate printing labels and barcode lists. At the

> moment we are fervently telling people to turn off "Page Scaling" (to

> None) before printing their documents.

>

> Is there a way that this could be set up automatically while generating

> the reportlab document? I have seen PDF documents that do this. For

> instance,

> http://www.outback.com/pressroom/pdf/restaurantnews_march2005.pdf shows

> that the Page Scaling can be turned off on the Print dialog.

>

> Any help is greatly appreciated.

>

> Thanks,

>

> Kevin at booksys.com

>

>

>

>

> ------------------------------

>

> Message: 3

> Date: Mon, 1 Oct 2007 16:00:16 +0100

> From: "Andy Robinson" <andy at reportlab.com>

> Subject: Re: [reportlab-users] Automatically set Page Scaling and

> Print?

> To: "Support list for users of Reportlab software"

> <reportlab-users at reportlab.com>

> Message-ID:

> <956003ae0710010800q6f1301drd6c2002b4e6daea3 at mail.gmail.com>

> Content-Type: text/plain; charset=UTF-8

>

> On 01/10/2007, kevin <kevin at booksys.com> wrote:

>

>> Hi all,

>>

>> We use reportlab to generate printing labels and barcode lists. At the

>> moment we are fervently telling people to turn off "Page Scaling" (to

>> None) before printing their documents.

>>

>> Is there a way that this could be set up automatically while generating

>> the reportlab document? I have seen PDF documents that do this. For

>> instance,

>> http://www.outback.com/pressroom/pdf/restaurantnews_march2005.pdf shows

>> that the Page Scaling can be turned off on the Print dialog.

>>

>

> That's really good news if Adobe has added a feature for this. We'll

> look at this file and the PDF specification and try to figure out what

> option to add. It's been a pain for everyone who ever tried to do

> labels in the last 6 years...

>

> Thanks,

>

> Andy

>

>

>> Any help is greatly appreciated.

>>

>> Thanks,

>>

>> Kevin at booksys.com

>>

>>

>> _______________________________________________

>> reportlab-users mailing list

>> reportlab-users at reportlab.com

>> http://two.pairlist.net/mailman/listinfo/reportlab-users

>>

>>

>

>

>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: avery.pdf
Type: application/pdf
Size: 17389 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20071001/7a0174c5/attachment-0001.pdf>


More information about the reportlab-users mailing list