On Fri, 10 Jan 2014, bill-lancaster wrote:
> I have a number of files in pdf format and I'd like to add some text to the
> image and save as a pdf file.
> Is this possible?
> If so, some hints as to how would be appreciated.
>
Hmm. I've personally used a tool called pdftk for manipulating PDFs - but it
was at least time consuming to install on Arch Linux but that's what we love
Arch for, isn't it? :-) Anyway, seems that it's not suitable for your purpose
and I see a pure Gambas way, too:
- Instantiate a new Image[], named myNewPdfImages, which will contain your
new annotated pages as Image objects;
- Define some Annotate() method (just for the purpose of this algorithm)
which takes a pristine Image, annotates (using Paint) and then returns it;
- Use gb.pdf. Load your PDF and loop through the pages:
For iInd = 0 To myPdf.Count - 1
myNewPdfImages[iInd] = Annotate(myPdf[iInd].GetImage())
Next
The key is myPdf[iInd].GetImage() to get an image of the iInd-th page;
- Now use gb.cairo or the like to coalesce your new Images into a new PDF.
Nice application by the way. I can't wait to write it myself :-)
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user