Live data from Hacker News

OpenPDF 1.3.0

github.com

31–40 of 63 posts

Re: OpenPDF 1.3.0

#31
Can this render PDF form fills? Because PDF.js can't read them, and I must use either PDFmaster or adobe.

Other question: Is it possible to build a document format similar to PDF around SVG?

Re: OpenPDF 1.3.0

#32
post #10

Earlier quoted context omitted.

There's already plenty of open source implementations of PDF parsing: Ghostscript, MuPDF, XPDF, Poppler, Pdfium, just to name the first few that come to mind.

All do not support typewriter or forms. This makes easier to fill up forms

Evince can handle forms most of the time. That said, Acrobat allows things like Livecycle (XFA) forms, which are nonstandard and will break just about everything outside of Acrobat. Outside of that, pdftk can handle forms using the forms data format (FDF):

https://www.iso.org/obp/ui/#iso:std:iso:19444:-1:ed-1:v1:en

Though, it was mostly an exercise in frustration. That said, IRS forms used to work great with this.

However, long story short, Evince works most of the time.

Re: OpenPDF 1.3.0

#33
post #21

Earlier quoted context omitted.

All do not support typewriter or forms. This makes easier to fill up forms

MuPDF supposedly supports forms in the latest version. I’ve never seen it work though.

Alright, so I noticed this before and just tried it again. While I can fill in forms, does anyone know how to save them? The man page says "S", but that doesn't work and I remember this causing issues for me in the past.

Re: OpenPDF 1.3.0

#34

My particular needs for PDF creation are somewhat unusual, so I'm not surprised that Acrobat Pro seems to be the only thing that suits my needs. If anyone knows of a PDF creation library that has good support for the various image compression schemes supported by PDF, I'd love to know about it. Currently I'm using a 10 year old paid version of Acrobat Pro because I'm unwilling to spend another $500 to get a modern co…

Use hugin for deskewing?

http://hugin.sourceforge.net/tutorials/perspective/en.shtml

Re: OpenPDF 1.3.0

#35
I've been heads down in PDF for about 6 months and looking at all the various and supported libraries.

Within Polar (https://getpolarized.io) we support pdf.js which is rather nice but ONLY supports viewing of the PDF and text extraction.

You can't create NEW PDFs.

Our plan is to use something like OpenPDF to get the best of both worlds. Editing PDFs for doing things like exporting could be done on the server and the rest done on the client.

Re: OpenPDF 1.3.0

#36
post #19

New Pure JavasScript low-level implementation to create and edit PDF files: https://github.com/Hopding/pdf-lib

Tangential question: Do you know of a method to render PDFs to HTML canvas other than PDF.js? PDF.js seems too slow for my purposes, though I haven't tested very thoroughly yet. I'm hoping with wasm Skia now available, there might be some other options coming.

how does Skia and pdf work together? I know there is a pdf backend but the way I understand it is that it just outputs pdf instead of an image

I recently started playing around with wasm Skia/CanvasKit but I have a hard time wrapping my head around what exactly it is supposed to be used for, as well as Skia in general.

For example, Skia allows text rendering and I could naively assume that if I want to build some high performance 2D UI that Rendering text with Skia would work reasonably well.

But at what level would text interactivity like selecting text happen?

I’m afraid this is a very generic question.

Are you familiar with any pdf or text related project that uses Skia and could help me better understand what role Skia plays?

Re: OpenPDF 1.3.0

#37
post #10
post #2

Pdf so badly needs a standard open source reference implementation. the problem with java is that it isn’t easy to reuse in other programming environment... something in C, or anything that compiles through LLVM would probably be a better choice i think.

There's already plenty of open source implementations of PDF parsing: Ghostscript, MuPDF, XPDF, Poppler, Pdfium, just to name the first few that come to mind.

And most of them are either (A)GPL or so prohibitively expensive for the commercial version that you can't really use them in small commercial projects at all.

Re: OpenPDF 1.3.0

#38
post #3

I tried to find a good comparison to PDFBox but came up short!

From my experience OpenPDF is better at formatting and layout. PDFBox is a lot lower level.

OpenPDF [1]:

  document.add(new Paragraph("Hello World"));
PDFBox [2]:

  contentStream.beginText();
  contentStream.setFont( font, 12 );
  contentStream.moveTextPositionByAmount( 100, 700 );
  contentStream.drawString( "Hello World" );
  contentStream.endText();

[1]: https://github.com/LibrePDF/OpenPDF/blob/master/pdf-toolbox/...

[2]: https://pdfbox.apache.org/1.8/cookbook/documentcreation.html

Re: OpenPDF 1.3.0

#39
post #23
post #2

Pdf so badly needs a standard open source reference implementation. the problem with java is that it isn’t easy to reuse in other programming environment... something in C, or anything that compiles through LLVM would probably be a better choice i think.

You can compile java to LLVM or create dll/so files. * https://www.graalvm.org/ * https://www.graalvm.org/docs/reference-manual/aot-compilatio... You only need to pass `--shared`. (You can also define multiple exports via public static ... and some annotations https://github.com/oracle/graal/blob/master/substratevm/READ... ) of course it's a little bit akward to first create a "JVM" library and then call that library…

That's a bad idea and Windows is still experimental.

Re: OpenPDF 1.3.0

#40

My particular needs for PDF creation are somewhat unusual, so I'm not surprised that Acrobat Pro seems to be the only thing that suits my needs. If anyone knows of a PDF creation library that has good support for the various image compression schemes supported by PDF, I'd love to know about it. Currently I'm using a 10 year old paid version of Acrobat Pro because I'm unwilling to spend another $500 to get a modern co…

Look into what OpenLibrary is using. I don't remember it off the top of my head, but there is a special image format for efficiently compressing scanned pages of text. Their files are vastly smaller than jpeg at the same quality.
Post reply on HN