Comments (6)
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.
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.
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.
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.
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.
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)
- single quotes disappear
- Unicode problem in fpdf HOT 3
- Ln parameter of Cell does not work. Ln() default does not work. Multicell causes divide by zero fault. HOT 2
- FPDF' object has no attribute 'y' HOT 2
- Code39 does not work HOT 1
- Template.split_multicell push data before FPDF.add_page called HOT 2
- Patch for /fpdf/template.py HOT 6
- Patch for /fpdf/template.py HOT 2
- Printing Trademark (TM) symbol in PDF HOT 6
- "ouput" has default/hard-coded fonts location - throws I/O exception when different location used HOT 4
- Fail using easyinstall for MacOSX and python 3.4 HOT 4
- Integer division causes divide by zero error when units is 'in'. Errant code identified, but no patch supplied. HOT 2
- Web2py sample app has what should be view code in the controller, but is easily fixable HOT 1
- pyfpdf html to pdf mis-handles '<', '>', '&' and ' in tables. HOT 4
- Vertical align in cell
- get_string_width report wrong value for missed glyphs HOT 2
- PDF document blocked HOT 2
- PYFEPDF in VBNET HOT 1
- Could not output pdf text to browser HOT 1
- Multiple pdf?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyfpdf.