Dear Sir / Madam,
Need to create pdf watermark as below: -
1) how to add rectangle
PdfMemDocument doc("D:\\sample pdf\\test.pdf");
PdfPainter painter;
PdfPage* pPage;
PdfRect rect;
PdfFont* pFont = doc.CreateFont("Times New Roman", new
PdfIdentityEncoding(0, 0xffff, true));
int i;
for (i = 0; i<doc.GetPageCount(); i++)
{
pPage = doc.GetPage(i);
if (!pPage)
PODOFO_RAISE_ERROR(ePdfError_InvalidHandle);
PdfExtGState gstate(&doc);
rect = pPage->GetPageSize();
painter.SetPage(pPage);
gstate.SetFillOpacity(0.5);
gstate.SetRenderingIntent(ePdfRenderingIntent_Saturation);
gstate.SetBlendMode(ePdfBlendMode_Darken);
painter.SetExtGState(&gstate);
painter.Save();
painter.SetStrokingColor(1.0, 0.0, 0.0);
painter.SetStrokeWidth(5);
painter.Rectangle(rect.GetWidth() - 205, rect.GetHeight()
- 55, 200, 50, 10, 10);
painter.DrawLine(0.0, 0.0, rect.GetWidth(),
rect.GetHeight());
painter.FinishPage();
}
doc.Write("D:\\sample pdf\\test2.pdf");
the pdf has rectangle and a line
but if
painter.Rectangle(rect.GetWidth() - 205, rect.GetHeight()
- 55, 200, 50, 10, 10);
//painter.DrawLine(0.0, 0.0, rect.GetWidth(),
rect.GetHeight());
the pdf rectangle is gone too
2) how to set all text and rectangle transparency
Thanks you.
With Regards,
Tang
------------------------------------------------------------------------------
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