AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de impresión
  • Preview of PDF print
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Prints the content:
  • of a PDF file.
  • WINDEVWEBDEV - Código ServidorAndroidWidget Android of a buffer containing a PDF.
  • WINDEVAndroid of a PDF Reader control.
What is the print destination?
  • iPhone/iPad When this function is used, a system window appears, allowing the user to select the printer to be used, the number of copies, etc.
  • AndroidWidget Android When this function is used, a system window appears, allowing the user to select the printer to be used, etc.
    Warning This function must be used in the application's main thread.
  • WINDEVWEBDEV - Código Servidor The default printer is used. The printer to use can be selected via iConfigure.
    WINDEV iDestination is used to preview the PDF file (see Remarks).
Ejemplo
IF iPrintPDF("MyFile.PDF") THEN
	Info("Printed successfully")
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 file existence
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
WINDEVWEBDEV - Código Servidor
// Print a buffer
MyPDFBuffer is Buffer
MyPDFBuffer = fLoadBuffer("C:\temp\Myfile.pdf")
IF iPrintPDF(MyPDFBuffer) THEN
	Info("Printed successfully")
END
Sintaxis

Printing a PDF file Ocultar los detalles

<Result> = iPrintPDF(<Name of PDF file> [, <Password> [, <Sizing> [, <List of pages>]]])
<Result>: Boolean
  • True if printed successfully,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
AndroidWidget Android Please note Printing is asynchronous: when the function is called, the print settings window is displayed. It is not possible to find out if the printout has been cancelled or if an error occurred during printing.
<Name of PDF file>: Character string
Name and path of PDF file to print. This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone or iPad, an application has the rights to write to its installation directory or one of its subdirectories
<Password>: Character string or Secret string
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Novedad versión 2025
Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro debe ser "ANSI o Unicode string".
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
Novedad versión 2025
AndroidWidget Android Las cadenas secretas no están disponibles para este parámetro en aplicaciones Android y widgets de Android.
AndroidWidget Android iPhone/iPad This parameter is not available.
<Sizing>: Integer constant
Print size:
iHomotheticHomothetic enlargement or reduction of the PDF document pages to adapt them to the output format, ignoring physical margins.
This constant corresponds to the option "Fit to paper size" available in PDF printing software.
iHomotheticWithoutGrowthHomothetic reduction of the PDF document pages to adapt them to the output format, ignoring physical margins. Pages with a smaller format keep their format and are centered.
This constant corresponds to the option "Shrink to fit paper size" available in PDF printing software.
iHomotheticNoEnlargementPrintableAreaHomothetic reduction of the PDF document pages to adapt them to the output format, taking into account physical margins. Pages with a smaller format keep their format and are centered.
This constant corresponds to the option "Fit to printer margins" available in PDF printing software.
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.

AndroidWidget Android iPhone/iPad This parameter is not available.
<List of pages>: Character string
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.
AndroidWidget Android iPhone/iPad This parameter is not available.
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidWidget Android Código de Usuario (UMC)

Printing a buffer corresponding to a PDF file Ocultar los detalles

<Result> = iPrintPDF(<Buffer name> [, <Password> [, <Sizing> [, <List of pages>]]])
<Result>: Boolean
  • True if printed successfully,
  • False otherwise.
AndroidWidget Android Please note Printing is asynchronous: when the function is called, the print settings window is displayed. It is not possible to find out if the printout has been cancelled or if an error occurred during printing.
<Buffer name>: Buffer
Name of Buffer variable corresponding to the PDF file to print.
<Password>: Character string or Secret string
  • Password for opening the PDF file,
  • Empty string ("") if the file has no password.
Novedad versión 2025
Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro debe ser "ANSI o Unicode string".
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
Novedad versión 2025
AndroidWidget Android Las cadenas secretas no están disponibles para este parámetro en aplicaciones Android y widgets de Android.
<Sizing>: Integer constant
Print size:
iHomotheticHomothetic enlargement or reduction of the PDF document pages to adapt them to the output format, ignoring physical margins.
This constant corresponds to the option "Fit to paper size" available in PDF printing software.
iHomotheticWithoutGrowthHomothetic reduction of the PDF document pages to adapt them to the output format, ignoring physical margins. Pages with a smaller format keep their format and are centered.
This constant corresponds to the option "Shrink to fit paper size" available in PDF printing software.
iHomotheticNoEnlargementPrintableAreaHomothetic reduction of the PDF document pages to adapt them to the output format, taking into account physical margins. Pages with a smaller format keep their format and are centered.
This constant corresponds to the option "Fit to printer margins" available in PDF printing software.
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.

AndroidWidget Android This parameter is not available.
<List of pages>: Character string
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.
WINDEVReportes y ConsultasAndroidCódigo de Usuario (UMC)

Printing the content of a PDF Reader control Ocultar los detalles

<Result> = iPrintPDF(<PDF Reader control> [, <Sizing> [, <List of pages>]])
<Result>: Boolean
  • True if printed successfully,
  • False otherwise.
Android Please note Printing is asynchronous: when the function is called, the print settings window is displayed. It is not possible to find out if the printout has been cancelled or if an error occurred during printing.
<PDF Reader control>: Character string
Name of PDF Reader control displaying the PDF file to print
<Sizing>: Integer constant
Print size:
iHomotheticHomothetic enlargement or reduction of the PDF document pages to adapt them to the output format, ignoring physical margins.
This constant corresponds to the option "Fit to paper size" available in PDF printing software.
iHomotheticWithoutGrowthHomothetic reduction of the PDF document pages to adapt them to the output format, ignoring physical margins. Pages with a smaller format keep their format and are centered.
This constant corresponds to the option "Shrink to fit paper size" available in PDF printing software.
iHomotheticNoEnlargementPrintableAreaHomothetic reduction of the PDF document pages to adapt them to the output format, taking into account physical margins. Pages with a smaller format keep their format and are centered.
This constant corresponds to the option "Fit to printer margins" available in PDF printing software.
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.

Android This parameter is not available.
<List of pages>: Character string
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.
Observaciones
WINDEV

Preview of PDF print

The PDF file to print can be displayed in the report viewer. Simply use function iDestination with constant iVisualizer before function iPrintPDF.
For example:
// Print the PDF in the report viewer
iDestination(iViewer)
iPrintPDF("c:\tmp\Convention.pdf")
Clasificación Lógica de negocio / UI: Código neutro
Componente: wd300etatexe.dll
Versión mínima requerida
  • Versión 18
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 16/05/2025

Señalar un error o enviar una sugerencia | Ayuda local