PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Google Cloud Print
  • Operating mode on the phone
  • Required permissions
  • Preview of PDF print
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
Prints the content of a PDF file from an iPhone/iPad or Android application. Prints the content:
  • of a PDF file.
  • Versions 23 and later
    WINDEVWEBDEV - Server code of a buffer containing a PDF.
    New in version 23
    WINDEVWEBDEV - Server code of a buffer containing a PDF.
    WINDEVWEBDEV - Server code of a buffer containing a PDF.
  • Versions 23 and later
    WINDEV of a PDF Reader control.
    New in version 23
    WINDEV of a PDF Reader control.
    WINDEV of a PDF Reader control.
What is the print destination?
  • iPhone/iPad When this function is called, a system window is displayed, allowing the user to select the printer to use, the number of copies, ...
  • AndroidAndroid Widget When this function is used, the print of PDF document is started by using the Cloud Print service of Google. This function is equivalent to GglPrintDocument.
  • Versions 23 and later
    WINDEVWEBDEV - Server code The printer to use can be chosen via iPreview and iDestination.
    WINDEV iPreview is used to preview the PDF file (see Notes).
    New in version 23
    WINDEVWEBDEV - Server code The printer to use can be chosen via iPreview and iDestination.
    WINDEV iPreview is used to preview the PDF file (see Notes).
    WINDEVWEBDEV - Server code The printer to use can be chosen via iPreview and iDestination.
    WINDEV iPreview is used to preview the PDF file (see Notes).
Versions 19 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
New in version 19
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Versions 23 and later
WINDEVReports and QueriesUser code (UMC) This function is now available for the WINDEV applications.
WEBDEV - Server code This function is now available for the WEBDEV sites.
New in version 23
WINDEVReports and QueriesUser code (UMC) This function is now available for the WINDEV applications.
WEBDEV - Server code This function is now available for the WEBDEV sites.
WINDEVReports and QueriesUser code (UMC) This function is now available for the WINDEV applications.
WEBDEV - Server code This function is now available for the WEBDEV sites.
Example
IF iPrintPDF("MyFile.PDF") THEN
Info("Print successfully performed")
END
iPhone/iPad
// Print the order form
FileName = fDataDir() + [fSep()] + StringBuild("ORF_%1.PDF", OrderNumber)
iDestination(iGenericPDF, FileName)
iPrintReport(RPT_OrderForm, OrderNumber, OrderNumber)

// Check the existence of the file
IF fFileExist(FileName) = False THEN
Error("The PDF file was not generated")
RETURN
END

// Confirmation to display the PDF
IF YesNo(Yes, "Display the generated order form (PDF format)?") = Yes THEN
// Display the generated order form
ShellExecute(FileName)
ELSE
iPrintPDF(FileName)
END
Versions 23 and later
WINDEVWEBDEV - Server code
// Print a buffer
MyPDFBuffer is Buffer
MyPDFBuffer = fLoadBuffer("C:\temp\Myfile.pdf")
IF iPrintPDF(MyPDFBuffer) THEN
Info("Print successfully performed")
END
New in version 23
WINDEVWEBDEV - Server code
// Print a buffer
MyPDFBuffer is Buffer
MyPDFBuffer = fLoadBuffer("C:\temp\Myfile.pdf")
IF iPrintPDF(MyPDFBuffer) THEN
Info("Print successfully performed")
END
WINDEVWEBDEV - Server code
// Print a buffer
MyPDFBuffer is Buffer
MyPDFBuffer = fLoadBuffer("C:\temp\Myfile.pdf")
IF iPrintPDF(MyPDFBuffer) THEN
Info("Print successfully performed")
END
Syntax

Printing a PDF file Hide the details

<Result> = iPrintPDF(<Name of PDF File> [, <Password> [, <Sizing> [, <List of Pages>]]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<Name of PDF File>: Character string (with quotes)
Name and path of PDF file to print. This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its setup directory or into one of its sub-directories.
<Password>: Character string (with quotes)
Versions 23 and later
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
New in version 23
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
<Sizing>: Integer constant
Versions 23 and later
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
New in version 23
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
<List of Pages>: Character string (with quotes)
Versions 23 and later
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
New in version 23
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
AndroidAndroid Widget iPhone/iPad This parameter is not available.
Versions 23 and later
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Printing a buffer corresponding to a PDF file Hide the details

<Result> = iPrintPDF(<Buffer Name> [, <Password> [, <Sizing> [, <List of Pages>]]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<Buffer Name>: Buffer
Name of Buffer variable corresponding to the PDF file to print.
<Password>: Character string (with quotes)
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Caution: This parameter is available from version 230042.
<Sizing>: Integer constant
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
<List of Pages>: Character string (with quotes)
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
New in version 23
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Printing a buffer corresponding to a PDF file Hide the details

<Result> = iPrintPDF(<Buffer Name> [, <Password> [, <Sizing> [, <List of Pages>]]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<Buffer Name>: Buffer
Name of Buffer variable corresponding to the PDF file to print.
<Password>: Character string (with quotes)
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Caution: This parameter is available from version 230042.
<Sizing>: Integer constant
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
<List of Pages>: Character string (with quotes)
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Printing a buffer corresponding to a PDF file Hide the details

<Result> = iPrintPDF(<Buffer Name> [, <Password> [, <Sizing> [, <List of Pages>]]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<Buffer Name>: Buffer
Name of Buffer variable corresponding to the PDF file to print.
<Password>: Character string (with quotes)
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Caution: This parameter is available from version 230042.
<Sizing>: Integer constant
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
<List of Pages>: Character string (with quotes)
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
Versions 23 and later
WINDEVReports and QueriesUser code (UMC)

Printing the content of a PDF Reader control Hide the details

<Result> = iPrintPDF(<PDF Reader control> [, <Sizing> [, <List of Pages>]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<PDF Reader control>: Character string (with or without quotes)
Name of PDF Reader control displaying the PDF file to print
<Sizing>: Integer constant
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
<List of Pages>: Character string (with quotes)
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
New in version 23
WINDEVReports and QueriesUser code (UMC)

Printing the content of a PDF Reader control Hide the details

<Result> = iPrintPDF(<PDF Reader control> [, <Sizing> [, <List of Pages>]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<PDF Reader control>: Character string (with or without quotes)
Name of PDF Reader control displaying the PDF file to print
<Sizing>: Integer constant
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
<List of Pages>: Character string (with quotes)
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
WINDEVReports and QueriesUser code (UMC)

Printing the content of a PDF Reader control Hide the details

<Result> = iPrintPDF(<PDF Reader control> [, <Sizing> [, <List of Pages>]])
<Result>: Boolean
  • True if the print was performed,
  • False otherwise.
<PDF Reader control>: Character string (with or without quotes)
Name of PDF Reader control displaying the PDF file to print
<Sizing>: Integer constant
Print size:
iHomotheticThe pages of PDF file are enlarged or reduced in homothetic mode so that they adapt to the output format.
iHomotheticNoEnlargementThe pages of PDF file are reduced in homothetic mode so that they adapt to the output format. The pages that use a format less than the output format keep their format and are centered.
iRealSizePrint in real size. The pages that use a format:
  • smaller than the output format are centered in the page.
  • bigger than the output format are truncated and are centered in the page.
Caution: This parameter is available from version 230042.
<List of Pages>: Character string (with quotes)
List of pages to print. You have the ability to specify the range of pages to print separated by a comma, each range being in 'X-Y' format where X and Y are numbers of pages.
Caution: This parameter is available from version 230042.
Remarks
AndroidAndroid Widget

Google Cloud Print

Google Cloud Print is a free service used to send, on Google servers, the files that will be printed on the preset printers. Therefore, the print is performed via Internet.
To use the Google Cloud Print service:
  1. Configure the printers on the site of Google Cloud Print.
  2. In the application, use iPrintPDF.
See the site for more details about the use conditions of Google Cloud Print service : http://www.google.com/cloudprint.
AndroidAndroid Widget

Operating mode on the phone

iPrintPDF opens several pages in the current application.
  • If the user is not connected, a page for connecting to Google is displayed. In this page, you must type the login and password of the Google account that was used to define the printers.
  • A page proposes the different available printers. All you have to do is select the requested printer to define the print options and to start the final print.
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: INTERNET: this permission allows the applications to open the network sockets.
Versions 23 and later
WINDEV

Preview of PDF print

The PDF file to print can be displayed in the print preview. All you have to do is call iPreview before iPrintPDF.
For example:
// Print the PDF in the print preview
iPreview()
iPrintPDF("c:\tmp\Convention.pdf")
New in version 23
WINDEV

Preview of PDF print

The PDF file to print can be displayed in the print preview. All you have to do is call iPreview before iPrintPDF.
For example:
// Print the PDF in the print preview
iPreview()
iPrintPDF("c:\tmp\Convention.pdf")
WINDEV

Preview of PDF print

The PDF file to print can be displayed in the print preview. All you have to do is call iPreview before iPrintPDF.
For example:
// Print the PDF in the print preview
iPreview()
iPrintPDF("c:\tmp\Convention.pdf")
Components
WINDEVWEBDEV - Server codeReports and Queries wd230etatexe.dll
Android wd230android.jar
Minimum required version
  • Version 18
This page is also available for…
Comments
EXEMPLO IPRINTPDF
https://youtu.be/D8u_sYcjEBk

http://windevdesenvolvimento.blogspot.com.br/2018/05/dicas-1761-publica-windev-novidade23-12.html

https://groups.google.com/d/forum/amarildowindev

// EXEMPLO

sFile is string
sFile = fSelect("", "", "Select a file...", "PDF" + TAB + "*.PDF", "*.PDF")
EDT_NOME_ARQUIVO_PDF=sFile

/ VOU FAZER COM QUE IMPRIMA NA TELA PRIMEIRO
// I'LL MAKE YOU PRINT ON THE FIRST SCREEN
// Je vais vous faire imprimer sur le premier écran

iPreview(ipvZoom100)

// VOU MANDAR IMPRIMIR PDF
// I WILL SEND PRINT PDF
// J'enverrai l'impression PDF

iPrintPDF(EDT_NOME_ARQUIVO_PDF,"",iRealSize,"")


De matos
May 29 2018