ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / PDF functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Adds a watermark to all or some pages of an existing PDF file.
Remark: This function can be used multiple times on the same document to add different watermarks.
Example
MyWatermark is Watermark
MyWatermark.Text = "Confidential"
MyWatermark.Font.Name = "Arial"
MyWatermark.Position = iCenterH + iBottom
 
MyPDF is pdfDocument = fExeDir() + [fSep()] + "RPT_NoName1.pdf"
 
// Add watermark to PDF document
PDFAddWatermark(MyPDF, MyWatermark)
 
MyWatermark.Text = "Confidential - Do not distribute"
// Add watermark to one page of the PDF document
PDFAddWatermark(MyPDF.Page[1], MyWatermark)
 
PDFSave(MyPDF, fExeDir() + [fSep()] + "RPT_NoName1_With_Watermark.pdf")
WINDEV
MyWatermark is Watermark
MyWatermark.Text = "Confidential"
MyWatermark.Font.Name = "Arial"
MyWatermark.Position = iCenterH + iBottom
 
MyPDF is pdfDocument = fExeDir() + [fSep()] + "RPT_NoName1.pdf"
 
// Add watermark to PDF Reader control
PDFAddWatermark(PDF_MyReader, MyWatermark)
Syntax

Adding a watermark to a page in a PDF document Hide the details

PDFAddWatermark(<Page> , <Watermark>)
<Page>: pdfPage variable
Name of the pdfPage variable that corresponds to the page of the PDF file in which the watermark is to be added.
<Watermark>: Watermark variable
Name of the Watermark variable that corresponds to the watermark to be added to the page.

Adding a watermark to a PDF document Hide the details

PDFAddWatermark(<Document> , <Watermark>)
<Document>: pdfDocument variable
Name of the pdfDocument variable that corresponds to the PDF document to be used.
<Watermark>: Watermark variable
Name of the Watermark variable that corresponds to the watermark to be added in all pages of the PDF document.
WINDEV

Adding a watermark to a document displayed in a PDF Reader control Hide the details

PDFAddWatermark(<PDF Reader control> , <Watermark>)
<PDF Reader control>: Control name
Name of PDF Reader control to use
<Watermark>: Watermark variable
Name of the Watermark variable that corresponds to the watermark to be added in all pages of the PDF document.
Related Examples:
PDFDocument type Unit examples (WINDEV): PDFDocument type
[ + ] This example shows how to use the pdfDocument WLanguage type.
This type is used to handle PDF files by programming.
You can:
- Retrieve the details of the PDF file (Created, Modified, Author, etc.)
- Retrieve the text of the PDF file (page by page and line by line)
- List / Add / Delete attachments
Component: wd300wdpdf.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/17/2024

Send a report | Local help