Re: [Podofo-users] Watermarks?

2018-02-22 Thread Olivier Mascia
> Le 22 févr. 2018 à 21:47, Matthew Brincke  a écrit :
> 
>> How about watermarking pages?
>> Either with text, images or PDF pages?
>> 
> I'm no expert for "watermarking", especially about securing/hardening
> against removal of such a watermark (e.g. e-books marked with customer data).

No need for such securing for what I want to do.
My use of the word "watermarking" was misleading. :)

>> I mean, take two existing PDF files A and B.
>> Update file A, placing content of page B.2 so it displays underneath
>> (or over) page A.1 existing content?
>> 
>> Or given PDF file A, add text or images underneath (or over) page A.2?
> Ah, that is meant: If there's any problem doing that with PoDoFo, it's the
> latter's bug ;-). Just append the page's stream to the watermark's (what
> comes later draws over the preceding content). In case graphics settings
> could be changed in a page without reset: call PdfPainter::Save() first
> (on an empty page, which has to be set first), then PdfPainter::GetCanvas(),
> append the background's content's stream PdfPage::GetContents()->GetStream()
> to the former's return object, call PdfPainter::Restore(), then append the
> foreground likewise, call PdfPainter::FinishPage() (is automatically called
> by SetPage()) and you should be set (sorry, I haven't tested this yet with
> a current revision of PoDoFo, so please report any oddities you see).
> 
>> 
>> Is there any known piece of code (even pseudo code of course or just some
>> explanations) which would give pointers on how to achieve this using PoDoFo
>> or building it around PoDoFo?
> 
> Please see above for an explanation/recipe. I hope this helps you.

The whole picture seems perfectly clear!!  Many many thanks.
I'll experiment on sat/sun.  I'll share any oddities I might find, hoping it 
won't be mistakes on my side.

-- 
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Watermarks?

2018-02-22 Thread Matthew Brincke
Hello Olivier, hello all,
On 22 February 2018 at 17:54 Olivier Mascia  wrote:
> 
> 
> Dear all,
> 
> How about watermarking pages?
> Either with text, images or PDF pages?
>
I'm no expert for "watermarking", especially about securing/hardening
against removal of such a watermark (e.g. e-books marked with customer data).

> I mean, take two existing PDF files A and B.
> Update file A, placing content of page B.2 so it displays underneath
> (or over) page A.1 existing content?
> 
> Or given PDF file A, add text or images underneath (or over) page A.2?
Ah, that is meant: If there's any problem doing that with PoDoFo, it's the
latter's bug ;-). Just append the page's stream to the watermark's (what
comes later draws over the preceding content). In case graphics settings
could be changed in a page without reset: call PdfPainter::Save() first
(on an empty page, which has to be set first), then PdfPainter::GetCanvas(),
append the background's content's stream PdfPage::GetContents()->GetStream()
to the former's return object, call PdfPainter::Restore(), then append the
foreground likewise, call PdfPainter::FinishPage() (is automatically called
by SetPage()) and you should be set (sorry, I haven't tested this yet with
a current revision of PoDoFo, so please report any oddities you see).

> 
> Is there any known piece of code (even pseudo code of course or just some
> explanations) which would give pointers on how to achieve this using PoDoFo
> or building it around PoDoFo?

Please see above for an explanation/recipe. I hope this helps you.
> 
> Thanks,
> -- 
> Best Regards, Meilleures salutations, Met vriendelijke groeten,
> Olivier Mascia
> 
Best regards, mabri

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] Watermarks?

2018-02-22 Thread Olivier Mascia
Dear all,

How about watermarking pages?
Either with text, images or PDF pages?

I mean, take two existing PDF files A and B.
Update file A, placing content of page B.2 so it displays underneath (or over) 
page A.1 existing content?

Or given PDF file A, add text or images underneath (or over) page A.2?

Is there any known piece of code (even pseudo code of course or just some 
explanations) which would give pointers on how to achieve this using PoDoFo or 
building it around PoDoFo?

Thanks,
-- 
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users