ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
  • Properties specific to the description of pdfDocument variables
  • Remarks
  • WLanguage functions that use pdfDocument variables
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
The pdfDocument type is used to get all the characteristics of a PDF file loaded in memory. The characteristics of this PDF file can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
MonPDF is pdfDocument = "test.pdf"
 
FOR EACH PageDocument OF MonPDF.Page
Trace(PageDocument.Hauteur)
END
 
PDFSave(MonPDF, "testmdp.pdf")
 
// Il est également possible d'utiliser la syntaxe préfixée
// MonPDF.Sauve("testmdp.pdf")
MonDocPDF is pdfDocument = PDFOpen("C:\temp\Monguide.pdf")
Trace(MonDocPDF.PDFVersion)
Trace(MonDocPDF.Author)
Trace(MonDocPDF.Page.Occurrence)
Trace(MonDocPDF.Page[1].Largeur)
Trace(MonDocPDF.Page[36].Hauteur)
 
FOR EACH UnElémentTexte OF MonDocPDF.Page[2].ElémentTexte
Trace(UnElémentTexte.Texte + " X = " +
UnElémentTexte.X + " Y = " + UnElémentTexte.Y + " L = " +
UnElémentTexte.Largeur + " H = " + UnElémentTexte.Hauteur)
END
 
MonDocPDF2 is pdfDocument = "C:\temp\plan.pdf"
// Ajout de pages
Add(MonDocPDF2.Page, MonDocPDF.Page[5])
// Insertion de pages
Insert(MonDocPDF2.Page, 1, MonDocPDF.Page[32])
// Enregistrement du PDF modifié
PDFSave(MonDocPDF2, "MonDocPDF2.pdf")
ShellExecute("MonDocPDF2.pdf")
Remarks

Properties specific to the description of pdfDocument variables

The following properties can be used to handle a PDF document:
Property nameType usedEffect
AttachmentArray of pdfAttachmentAttachments of PDF document.
It is possible to delete or add attachments to a document using array management functions (Add, Delete, ... on the array of pdfAttachment variables).
iPhone/iPad Management of attachments is not available.
AuthorCharacter stringAuthor of the document (only if this information is available in the PDF document).
This property is read-only.
DateCreatedDateTimeDate and time the document was created (only if this information is available in the PDF document).
This property is read-only.
This property corresponds to "CreationDate" in previous versions.
DateModifiedDateTimeDate and time the document was last modified (only if this information is available in the PDF document).
This property is read-only.
This property corresponds to "ModificationDate" in previous versions.
GeneratorCharacter stringName of the program that generated the document (only if this information is available in the PDF document).
This property is read-only.
KeywordCharacter stringDocument keyword (only if this information is available in the PDF document). If several keywords are specified, the separator used depends on the generator.
This property is read-only.
PageArray of pdfPagePages of the PDF document.
It is possible to delete or add pages to a document using array management functions (Add, Delete, ... on the array of pdfPage variables).
PDFVersionCharacter stringVersion of the PDF standard used in the PDF document.
This property is read-only.
New in version 28
Signet
Array of pdfBookmarkDocument bookmarks PDF.
AndroidAndroid Widget iPhone/iPad Bookmark management is not available.
TitleCharacter stringDocument title (only if this information is available in the PDF document).
This property is read-only.
ValueCharacter string or BufferPDF document. This property can correspond to:
  • the path of the PDF document,
  • the buffer containing the PDF document.

Remarks

  • To initialize the pdfDocument variable, simply assign a string or (buffer) containing a PDF file. It is then possible to modify the document (by adding attachments or setting a password, for example) and then save it again by calling PDFSave.
  • It is possible to delete or add pages to a document using array functions (Adds, Deletes, ... on the array of pdfPage variables). Similarly, it is possible to add or delete attachments.

WLanguage functions that use pdfDocument variables

PDFAddWatermarkAdds a watermark to all or some pages of an existing PDF file.
PDFCloseCloses the PDF file loaded in memory in a pdfDocument variable.
PDFNbSignaturesGets the number of signatures in a PDF document.
PDFOpenOpens a PDF document and loads it in a pdfDocument variable.
PDFGetSignatureDateGets the date of one of the signatures of a PDF document.
PDFGetSignatureGets the signature of a PDF document as a buffer.
PDFSaveSaves the content of a pdfDocument variable in a ".PDF" file.
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
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment