Hi,
I am using wxPdfDocument to generate a pdf file. I am thinking to use template and just replace the text in this pdf, for example {name} --> Jack.
Is it possible?
Thank you
wxPDFdocument, replace a text in a pdf file.
Re: wxPDFdocument, replace a text in a pdf file.
No. wxPdfDocument allows to generate PDF files from scratch and it allows to reuse whole pages of existing PDF files. It has no direct support for manipulating the content of existing pages.ajm wrote:I am using wxPdfDocument to generate a pdf file. I am thinking to use template and just replace the text in this pdf, for example {name} --> Jack.
Is it possible?
There are classes in wxPdfDocument which allow to access the various objects of an existing PDF file. However, replacing text within a page would require to parse the content stream of a page. The latter is definitely not supported by wxPdfDocument.
Regards,
Ulrich
Re: wxPDFdocument, replace a text in a pdf file.
Thank you utelle.
Re: wxPDFdocument, replace a text in a pdf file.
What about extracting the text? is it possible?
Re: wxPDFdocument, replace a text in a pdf file.
Again, this would require to parse the content stream of a page. And that is not supported by wxPdfDocument. So the answer to your question is No, unless you write a content parser yourself.ajm wrote:What about extracting the text? is it possible?
Extracting text from pages of a PDF file is not a trivial task, since you have to deal with text encodings related to the fonts used to create the document.
Regards,
Ulrich
Re: wxPDFdocument, replace a text in a pdf file.
I think, I am not able to write a content parser. so i should find another library or else.
Thank you again.
Thank you again.