athenapdf icon indicating copy to clipboard operation
athenapdf copied to clipboard

is it possible to use it as a library?

Open winteraz opened this issue 6 years ago • 2 comments

I'm trying to figure out how to use athenapdf as a library. I just want to handle the conversion directly without docker, queues, electron and other stuff.

E.g. func ConvertHTMLToPDF(htmlContent []byte)(pdfCOntent []byte, err error). Where can I find the core code that handles the pdf conversion?

winteraz avatar Dec 05 '17 11:12 winteraz

Apologies for the very slow response @winteraz.

Yes, you can use it as a library. It is probably easier in v3 than it is in its current incarnation.

See: https://github.com/arachnys/athenapdf/tree/v3/pkg/converter

You can see how it is being used as a library here.

If you want to go even lower, you can interact with the 'runner': https://github.com/arachnys/athenapdf/blob/v3/pkg/runner/runner.go

Bear in mind, if you use the Chrome-based converter, you will have to have Chrome installed in the environment running the converter.

MrSaints avatar Dec 15 '17 14:12 MrSaints

Hi, how stable is the converter package? Do you treat it as public or does the interface change often?

byrnedo avatar Mar 26 '18 08:03 byrnedo