PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
New WINDEV, WEBDEV and WINDEV Mobile 25 feature!
  • Properties specific to the description of pdfDocument variables
  • Remarks
  • WLanguage functions that use docDocument variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
The pdfDocument type is used to find out all the characteristics of a PDF file loaded in memory. The characteristics of this PDF file can be defined and modified using several WLanguage properties.
Remark: See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
Versions 250064 and later
Versions 25 and later
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
New in version 25
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
New in version 250064
Versions 25 and later
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
New in version 25
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
Versions 25 and later
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
New in version 25
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
iPhone/iPad From version 25 Update 1 (250064), this type of variable is available for iPhone/iPad applications.
Android Widget From version 25 Update 1 (250064), this type of variable is available in Android Widget mode.
Android From version 25 Update 1 (250064), this type of variable is available for Android applications.
WINDEVLinux From version 25 Update 1 (250064), this type of variable is available for WINDEV applications in Linux.
WEBDEV - Server codeLinux From version 25 Update 1 (250064), this type of variable is available for WEBDEV sites in Linux.
Example
MyPDF is pdfDocument = "test.pdf"
 
FOR EACH DocumentPage OF MyPDF..Page
Trace(DocumentPage..Height)
END
 
PDFSave(MyPDF, "passwordtest.pdf")
 
// It is also possible to use prefixed syntax
// MyPDF.Save("passwordtest.pdf")
MyPDFDoc is pdfDocument = PDFOpen("C:\temp\Myguide.pdf")
Trace(MyPDFDoc..PDFVersion)
Trace(MyPDFDoc..Author)
Trace(MyPDFDoc..Page..Count)
Trace(MyPDFDoc..Page[1]..Width)
Trace(MyPDFDoc..Page[36]..Height)
 
FOR EACH ATextElement OF MyPDFDoc..Page[2]..TextElement
Trace(ATextElement..Text + " X = " +
ATextElement..X + " Y = " + ATextElement..Y + " L = " +
ATextElement..Width + " H = " + ATextElement..Height)
END
 
MyPDFDoc2 is pdfDocument = "C:\temp\plan.pdf"
// Add pages
Add(MyPDFDoc2..Page, MyPDFDoc..Page[5])
// Insert pages
Insert(MyPDFDoc2..Page, 1, MyPDFDoc..Page[32])
// Save modified PDF
PDFSave(MyPDFDoc2,"MyPDFDoc2.pdf")
ShellExecute("MyPDFDoc2.pdf")
Remarks

Properties specific to the description of pdfDocument variables

The following properties can be used to handle a PDF document:
Property nameType usedEffect
AuthorCharacter stringAuthor of the document (only if this information is available in the PDF document).
This property is available in read-only.
CreationDateDateTimeDocument creation date and time (only if this information is available in the PDF document).
This property is available in read-only.
ModificationDateDateTimeDate and time of last modification of the document (only if this information is available in the PDF document).
This property is available in read-only.
GeneratorCharacter stringName of the program that generated the document (only if this information is available in the PDF document).
This property is available in 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 available in 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).
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).
Remark: Management of attachments will be available in a future update.
iPhone/iPad Management of attachments is not available.
TitleCharacter stringDocument title (only if this information is available in the PDF document).
This property is available in read-only.
ValueCharacter string or BufferPDF document. This property can correspond to:
  • the path of the PDF document,
  • the buffer containing the PDF document.
PDFVersionCharacter stringVersion of the PDF standard used in the PDF document.
This property is available in read-only.

Remark: These properties can be handled by using one of the following syntaxes:
  • <Variable name>..<Property name>
  • <Variable name>.<Property name>

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 management functions (Add, Delete, ... on the array of pdfPage variables). Similarly, it is possible to add or delete attachments.

WLanguage functions that use docDocument variables

Versions 25 and later
PDFClose
New in version 25
PDFClose
PDFClose
Closes the PDF file loaded in memory in a pdfDocument variable.
Versions 25 and later
PDFOpen
New in version 25
PDFOpen
PDFOpen
Opens a PDF document and loads it in a pdfDocument variable.
Versions 25 and later
PDFSave
New in version 25
PDFSave
PDFSave
Saves the content of a pdfDocument variable in a ".PDF" file.
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment