Is it possible to use a page from a PDF file to watermark a page instead of drawing your watermark?
Below is the C/AL code I'm using, may look a bit weird but you should get the jest.
PDFSourceFile := PDFSourceFile.File('C:\Temp\Pages\Sales Document - Test.pdf');
PDFWatermarkFile := PDFWatermarkFile.File('C:\Temp\Pages\blah.pdf');
PDFSourceDocument := PDFSourceFile.Document;
PDFWatermarkDocument := PDFWatermarkFile.Document;
PDFSourcePages := PDFSourceDocument.Pages();
PDFSourcePage := PDFSourcePages.Item(0);
PDFWatermarkSourcePage := PDFWatermarkDocument.Pages().Item(0);
PDFPageStamper := PDFPageStamper.PageStamper();
PDFPageStamper.Page := PDFSourcePage;
PDFComposer := PDFPageStamper.Foreground;
'C:\Temp\Pages\Sales Document - Test - PDFClown2.pdf',
When I open the saved document I cannot see the watermark :(
I have solved the issues I was having by writing a wrapper in C# and it works now.
If it is possibly to embody it into pdfclown i'm sure stefanio would be happy to get a patch for it?
There is only one more thing I would like to be able to do before creating a patch:
Change the alpha value for the page used as a watermark.
I'm guessing that would involve scanning the contents and changing the FillAplha value for each object but I'm not sure how to apply the new FillAplha to each object within an existing page.
It is also possible that I'm missing a much easier way to do this :E
Apart from creating a page that is already faded for use as a watermark of course :P
you might want to have a look at chapter "7.5.5 Transparency Group XObjects" of the PDF Specification (Version 1.6).
That might be the way to do it. Unfortunately I can't currently look at it myself.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.