Generate PDF Advanced
The advanced method allows the version of the item to be specified, as well as the PDF output options.
- Connect to the configuration web service.
- Configure the options as required.
- Specify the identifier of the item.
- Specify the version of the item.
Code Sample
# Get the current default options.
$pdfOptions = $xia.GET_CurrentPdfOptions();
# Configure the options.
$pdfOptions.ShowRelationships = $false;
$pdfOptions.Author = "Sample Author";
# Set a password.
$encryptedPassword = $xia.GET_EncryptedPassword("password");
$pdfOptions.Password.EncryptedPassword = $encryptedPassword;
# Generate the current version of the item PDF as a byte array.
$data = $xia.GET_PdfOutput(1000, 0, $pdfOptions);
# Write the PDF to a file.
Write-Host "Saving PDF file...";
$filename = "$env:temp\sample.pdf";
[IO.File]::WriteAllBytes($filename, $data);
# Display the file.
[System.Diagnostics.Process]::Start($filename);