Methods and properties for modifying the content of a PDF document:
Common | Common page operation methods and properties: | |
Graphics | Page operation graphics methods: | |
Text | Page operation text methods and properties: |
{ PDF object is supposed to be created } img := PDF.AddImageFromFile('watermark.jpg'); { composing a watermark } wtm := PDF.AddWatermark(); PDF.SwitchToWatermark(wtm); PDF.ShowImage(img, 300, 500); PDF.SetColorFill(0, 1, 0, 0); PDF.ShowTextAt(330, 530, 'Watermark text'); PDF.SwitchToCurrentPage; //composing 1st page PDF.ShowTextAt(50, 50, 'Page1 with watermark.'); PDF.AttachWatermark(0, wtm); //composing 2nd page PDF.NewPage; PDF.ShowTextAt(50, 50, 'Page2 with watermark.'); PDF.AttachWatermark(1, wtm); //composing 3rd page PDF.NewPage; PDF.ShowTextAt(50, 50, 'Page3 with watermark.'); PDF.AttachWatermark(2, wtm); PDF.SaveToFile('test.pdf', true);
// PDF object is supposed to be created long img = PDF->AddImageFromFile("watermark.jpg"); // composing a watermark long wtm = PDF->AddWatermark(); PDF->SwitchToWatermark(wtm); PDF->ShowImage(img, 300, 500); PDF->SetColorFill(0f, 1f, 0f, 0f); PDF->ShowTextAt(330, 530, "Watermark text"); PDF->SwitchToCurrentPage(); //composing 1st page PDF->ShowTextAt(50, 50, "Page1 with watermark."); PDF->AttachWatermark(0, wtm); //composing 2nd page PDF->NewPage(); PDF->ShowTextAt(50, 50, "Page2 with watermark."); PDF->AttachWatermark(1, wtm); //composing 3rd page PDF->NewPage(); PDF->ShowTextAt(50, 50, "Page3 with watermark."); PDF->AttachWatermark(2, wtm); PDF->SaveToFile("test.pdf", true);
// PDF object is supposed to be created long img = PDF.AddImageFromFile("watermark.jpg"); // composing a watermark long wtm = PDF.AddWatermark(); PDF.SwitchToWatermark(wtm); PDF.ShowImage(img, 300, 500); PDF.SetColorFill(0f, 1f, 0f, 0f); PDF.ShowTextAt(330, 530, "Watermark text"); PDF.SwitchToCurrentPage(); //composing 1st page PDF.ShowTextAt(50, 50, "Page1 with watermark."); PDF.AttachWatermark(0, wtm); //composing 2nd page PDF.NewPage(); PDF.ShowTextAt(50, 50, "Page2 with watermark."); PDF.AttachWatermark(1, wtm); //composing 3rd page PDF.NewPage(); PDF.ShowTextAt(50, 50, "Page3 with watermark."); PDF.AttachWatermark(2, wtm); PDF.SaveToFile("test.pdf", true);
' PDF object is supposed to be created img = PDF.AddImageFromFile("watermark.jpg") ' composing a watermark wtm = PDF.AddWatermark PDF.SwitchToWatermark wtm PDF.ShowImage img, 300, 500 PDF.SetColorFill 0, 1, 0, 0 PDF.ShowTextAt 330, 530, "Watermark text" PDF.SwitchToCurrentPage 'composing 1st page PDF.ShowTextAt 50, 50, "Page1 with watermark." PDF.AttachWatermark 0, wtm 'composing 2nd page PDF.NewPage PDF.AttachWatermark 1, wtm PDF.ShowTextAt 50, 50, "Page2 with watermark." 'composing 3rd page PDF.NewPage PDF.AttachWatermark 2, wtm PDF.ShowTextAt 50, 50, "Page3 with watermark." PDF.SaveToFile "test.pdf", true