Editing file
Good morning,
I would like to create a program in PureBasic to generate rent receipts. I have a pdf model (possibly another LibreOffice format) with my signature and I would like:
1) Open this template
2) Being able to modify the dates, possibly the amounts
3) Save the updated document
4) Send it by email
I must admit that I don't know how to do this at all and whether it is possible in PureBasic.
Thank you for your help.
Editing file
Re: Editing file
You can't open and/or edit template (.doc, .pdf etc) with PBjak64 wrote: Sun Jan 05, 2025 7:25 pm I would like to create a program in PureBasic to generate rent receipts. I have a pdf model (possibly another LibreOffice format) with my signature and I would like:
1) Open this template
2) Being able to modify the dates, possibly the amounts
3) Save the updated document
4) Send it by email
But you can create new pdf file.
See help VectorDrawing create text, frames, insert image (signature) and use PdfVectorOutput()
Re: Editing file
Of course it's possible. I've never done it, though. My first thought is to have an image with blank spots for the editable parts, and just draw text on those parts with the relevant data that you've entered. Then email the image as an attachment when done.
Re: Editing file
I made such a program on Autoit3. DOCX file is an archive. You need to unpack the archive, make the replacement of texts and pack it back. One woman asked me to make her templates, since she had to fill out 6 documents for each transaction, and if it were a program that automatically inserted the client’s data, this would simplify the routine. The window opens where it enters the client’s data, and the program inserts this data into the contract.Marc56us wrote: Sun Jan 05, 2025 9:53 pm You can't open and/or edit template (.doc, .pdf etc) with PB
The author asks too much, as if we must write a program for him.
Re: Editing file
There's no need to make a program, the mailing function of all word processors will do it all by itself (a table for addresses and amounts and a form for the letter.)
Save as PDF so that it can be read by any OS, even without an image viewer.
Other solution: create a PDF form (free with LibreOffice).
But if the author wants a PB program, then the VectorDrawing solution is the simplest (there's not much information to write in a rent receipt). This is also the simplest solution if your word processor doesn't include a function for writing the amount in words. (Some versions of spreadsheets may have it, but it's also a solution.)
Save as PDF so that it can be read by any OS, even without an image viewer.
Other solution: create a PDF form (free with LibreOffice).
But if the author wants a PB program, then the VectorDrawing solution is the simplest (there's not much information to write in a rent receipt). This is also the simplest solution if your word processor doesn't include a function for writing the amount in words. (Some versions of spreadsheets may have it, but it's also a solution.)
Re: Editing file
Hello everyone,
thank you for your messages.
I didn't want anyone to write a program for me, I just wanted to know if we could modify an existing PDF document.
Have a nice day everyone
thank you for your messages.
I didn't want anyone to write a program for me, I just wanted to know if we could modify an existing PDF document.
Have a nice day everyone
Re: Editing file
@jak64
maybe you find something in this thread: Replace text in .pdf file?
maybe you find something in this thread: Replace text in .pdf file?
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).

