Giter VIP home page Giter VIP logo

one-file-pdf's People

Contributors

balacode avatar bholdsworthamplify avatar brianholdsworth avatar marcosinger avatar

Stargazers

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

Watchers

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

one-file-pdf's Issues

png_images.pdf (demo) is larger than estimated

The generated png_images.pdf is about 6MB in size,
but based on my estimates it should be under 3MB:

dice.png is 420 x 315 pixels = 132,300 pixels
132,300 pixels x 3 colors = 396,900 bytes for RGB data
396,900 x 5 background varieties = 1,984,500 bytes

gophers.png is 600 x 476 pixels = 285,600 pixels
285,600 x 3 colors = 856,800 bytes for RGB data

Additional data for PDF commands, let's say 200K

The file size should be about 3MB,
but the generated demo is 6MB

** What to consider: **

  • Is the library reusing all repeated images?
  • Can the image byte stream be compressed to save space?

How to support Unicode in the PDF format?

Unicode support is essential in modern software, so we are going to implement some kind of Unicode support in this PDF writer. If you know or can link to any information about font embedding (to enable Unicode) or just referencing external fonts installed on the system in order to use Unicode, please let me know. Thanks for your attention.

No support for simple color (RGB) PNG images

I have been experimenting with using color PNG images with DrawImage() method, and so far found this to work with just a two line change. Is there much more than this needed in order to officially support color images instead of grayscale?

screen shot 2018-03-11 at 10 34 59 pm
screen shot 2018-03-11 at 10 35 20 pm

NextLine() calc seems wrong

I tried to use nextline() and the x was zeroed but the Y was set o 2019.987654.
Something is not correct in the compute or the various devfaults.

Streaming mode

Hello, first of all, I like this library, minimal yet powerful.

I have one question; does the API support streaming the pdf to disk, that way one could write lots of data to the PDF without being held in memory all at once?

PNG embedding is slow

Noticeable time (about 1 second) is spent when generating png_images.pdf

  • Is the library regenerating every PNG image, even if it is repeated?
  • If decoding and re-encoding the image data in a PDF stream is a slow operation, then goroutines could be used to speed up the process.

Return error(s) where possible please

How to know that SaveFile failed except by reading log?
Please return errors instead of logging them.

Application code should log, libraries should not log but return errors.

Other than that good library looking forward using it. Thanks.

PDF Metadata not properly encoded

The metadata fields like Title, Subject, Author, etc. are not shown in the rendered PDF because the /Type/Info object isn't properly delimited by the code.

To fix this, add call to pdf.writeObj near line 1081, like so:

screen shot 2018-03-05 at 10 43 19 am

SaveFile method creates unreadable file

In SaveFile, ioutil.WriteFile is used to save the file without any file attributes. Therefore, the file cannot be read until one performs a chmod to set reasonable attributes.

var err = ioutil.WriteFile(filename, pdf.Bytes(), 0)

should be

var err = ioutil.WriteFile(filename, pdf.Bytes(), 0644)

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.