Giter Club home page Giter Club logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Added the code with a web2py example project at 
https://github.com/jredrejo/Labels-for-pyfpdf

Original comment by [email protected] on 1 Oct 2011 at 3:41

from pyfpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Yes, your are welcome, thanks!

If you don't broke anything, you can just commit the changes ;-)

Please create a scripts directory for pdflabels.py

A wiki page explaining how it works would be good.

Original comment by [email protected] on 3 Oct 2011 at 5:46

from pyfpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Code changes committed in rev 208314825f21
I'll upload an example of use and a wiki page asap.

Original comment by [email protected] on 7 Oct 2011 at 11:55

  • Changed state: Fixed

from pyfpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
When I tried to use it, the Avery-5160 did not format correctly.  I got it to 
work by changing it to:

'Avery-5160':{'paper-size':'letter', 'metric':'mm', 
'marginLeft':6.762,'marginTop':12.7,'NX':3,'NY':10,'SpaceX':3.175,'SpaceY':0, 
'width':66.675,'height':25.4,'font-size':10}

I believe the marginTop was a typo during inch-mm conversion from the Avery 
specs.  The marginLeft may have been okay, but all of the labels were left 
justified.  Not sure if that should be changed in the code or not.  The 
font-size is a personal preference.

Original comment by [email protected] on 21 Jul 2014 at 8:22

from pyfpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
I can not confirm it because I don't have that avery paper. I based this  on 
http://fpdf.de/downloads/addons/29/ . The differences between both values don't 
match with a inches-mm conversion error. Now I have found 
https://github.com/lsolesen/fpdf/blob/master/examples/label/PDF_Label.php that 
adds some improvement to the previous code, but it still keeps the same margin 
values.
Is there any source with the right values that we can trust?

Original comment by [email protected] on 23 Jul 2014 at 9:19

from pyfpdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
This page is the second result when doing a Google search "python avery 
labels". So, if someone else comes here wanting a straightforward how-to, 
here's what worked for me:

1. pip install fpdf
2. Download 
https://raw.githubusercontent.com/jredrejo/Labels-for-pyfpdf/master/pyfpdf/pdfla
bels.py into your working directory.

Example code:
    import pdflabels # pity this can't be merged into the fpdf package

    pl = pdflabels.PDFLabel('Avery-5160')
    pl.add_page()
    pl.add_label("%s\n%s\n%s\n%s %s"%("Joe Blow","123 Main St","Anytown","Anystate","XY 12345")
    pl.add_label(....)
    pl.output('addresslabels.pdf', 'F')


Original comment by [email protected] on 30 Nov 2014 at 11:51

from pyfpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.