Giter Club home page Giter Club logo

pypdflite's People

Contributors

johnwlockwood avatar katerina7479 avatar tjoneslo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pypdflite's Issues

Plan to support non-english UTF-8 characters?

I'm curious if there's a plan to support non-english characters in pypdflite, and if so, what is the preferred approach? I'm working on adding this support in a fork I've made, and I would love to get any input from you about how you envision this working.

I believe it's a matter of loading a full unicode font, but also something else?

Any input you have would be hugely valuable. Thanks again for creating such a helpful module!

Support for Unicode text strings

I've tried forking and outputting text using UTF-16BE that PDFs support but can't seem to get it to render without interpreting the two-byte chars as two different characters. Maybe it is a font issue. Do you have interest in fixing or should I migrate to report lab or something similar?

PNGTest is missing images

The pngtest.py references three png files. These files are missing:

bin/example.png
bin/apple_logo.png
bin/background.png

Linux TTF fonts can't be found

When I try to run the TrueTypeTest, it fails with the error:
"Exception: comic sans ms not a valid font name"

The core problem seems to be the FontLoader.get_ttf() generating the TTF font dictionary with entries like this:

'comic_sans_ms': '/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf'

If I change the test to load the comic_sans_ms font the test passes. But fails on the Arial Bold loading. Again looking at the dictionary, I find:

'arial__italic': '/usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf'

meaning the naming process puts two underscores between the font name and the style.

Typo in percent numeric format ?

Maybe % should be escaped with %% in pypdflite/pdfobjects/pdfcell.py line 46
is:
self.text = '%s %' % self.text
would work:
self.text = '%s %%' % self.text

Sorry for the "patch" form: newbie with Git

Exception('Missing Palette')

Hi there,
Thanks for pypdflite!
When I try to add png image I get the Exception('Missing Palette'), not sure why. It doesn't happen with any other png file. I edited the original file after the first time I got the exception. It only uses 4 colors and is basically black and white. Any ideas?
Thanks!

center text or image

Hello
I use your great library to create a bunch of pdfs.
I wnat to include a series of image with a foot text in the center of the page
The proble is, that they have different width, so I cnnot set the cursor precisely.
Is there a generic way to center the images and texts?

Reference to runexamples.py in setup.py causing installation issues

Trying to update to the latest code, I get an error when doing a pip install -U pypdflite due to a reference to bin/runexamples.py in the setup.py file on line 9, which reads:

scripts=['bin/runexamples.py'],

In your last commit the runexamples.py file moved to the root of the project, so I believe that line should be:

scripts=['runexamples.py'],

(Thanks for the great work here!)

Fonts cannot be loaded

>>> import pypdflite
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pypdflite/__init__.py", line 1, in <module>
    from pdflite import PDFLite
  File "/usr/lib/python2.7/site-packages/pypdflite/pdflite.py", line 4, in <module>
    from .pdfdocument import PDFDocument
  File "/usr/lib/python2.7/site-packages/pypdflite/pdfdocument.py", line 13, in <module>
    from pdfobjects.pdfttfonts import PDFTTFont
  File "/usr/lib/python2.7/site-packages/pypdflite/pdfobjects/pdfttfonts.py", line 8, in <module>
    TTFONTS = pickle.load(open(os.path.join(FONT_DIR, 'font_dict.p'), 'rb'))
IOError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/pypdflite/fonts/font_dict.p'

I installed pypdflib with pip. The font file is missing from MANIFEST, which suggests you need to create a MANIFEST.in and list them there. (Note it should be MANIFEST.in, not MANIFEST.ini.) Further, your setup.py may need to be altered to ensure the font_dict.p is installed in the expected place.

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.