package pdfium
/*#cgo CXXFLAGS: -I${SRCDIR}/include -std=c++11#cgo CFLAGS: -I${SRCDIR}/include#cgo LDFLAGS: -L${SRCDIR}/libs -lpdfium#include <fpdfview.h>#include <fpdf_edit.h>#include <fpdf_doc.h>#include <stdlib.h>*/import "C"import ( "sync")
var mut sync.Mutex
type Context struct{}
func NewContext() *Context { mut.Lock() defer mut.Unlock()
C.FPDF_InitLibrary()
return &Context{}}
func (c *Context) Close() error { mut.Lock() defer mut.Unlock()
C.FPDF_DestroyLibrary() return nil}
//func (c *Context) NewDoc() *Doc {// mut.Lock()// defer mut.Unlock()//// return &Doc{// cdoc: C.FPDF_CreateNewDocument(),// }//}
--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To post to this group, send email to pdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/120b471d-2806-466a-a139-a0f6cfc1f18d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
![]() | Rodrigo Aliste Gerente de Producto (CPO) |
We use it for rendering page bitmaps into PNG and for metadata extraction. We basically implemented what Jonas already shared, but we took a subprocess approach as we needed random document access and high concurrency (we use it as part of an RPC system).
El mar., 23 oct. 2018 a las 18:28, Jonas Brunsgaard (<jonas.b...@gmail.com>) escribió:
I just started working on it.--
https://github.com/brunsgaard/go-pdfium-render/
On Thursday, 26 April 2018 22:31:14 UTC+2, Ryan Pendergast wrote:Wondering if anyone has experience using pdfium from go. I know you can compile go programs to use c[++] libs via cgo, however I haven't used c[++] in forever and can't figure out how to write a go program to utilize the pdfium lib.ninja -C out/build pdfium
produces a obj/libpdfium.a file. Does anyone have experience with this, that can give me a small example of how I would include libpdfium.a into my go program and call a function? An example using cgo to compile said program would also be very helpful.My end goal is to fill out FDF fields in a PDF using go.thanks in advance
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdf...@googlegroups.com.
To post to this group, send email to pdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/120b471d-2806-466a-a139-a0f6cfc1f18d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.