Unofficial Content

Rebuild a PDF from Base64 (FromBase64)

Objective

The symmetric, inverse operation of ToBase64: from a Base64 text, it generates the corresponding physical PDF file.

Parameters

Parameter Required Description
Base64 Yes Base64 text to decode.
Destination path Yes Path where the rebuilt PDF file will be generated.

Result

Operation status (Error / ErrorMessage) via PDFToolsStatus.

Functional details

  • File type validation: before generating the destination file, it is validated in memory that the received text is valid Base64 and that, once decoded, the content actually corresponds to a well-formed PDF. If either of these two conditions is not met, the operation fails with a message indicating that the file type is not compatible, and the destination file is not generated (no partial or incorrect file is left at that path).

  • Since this content can potentially be large, the input Base64 value is not included in the component's log record; only its length is logged as a size reference. See How to enable the log.

Usage example

&PDFBase64     = "JVBERi0xLjQKJc..."
&PDFFileTarget = "C:\Documents\PdfFromBase64.pdf"

&PDFToolsStatus = &PDFToolsUtils.FromBase64(&PDFBase64,&PDFFileTarget)

Error and warning messages

Situation Type Message / behavior
The received text is not valid Base64 Error "Incompatible file type: the provided content is not valid Base64." The destination file is not generated.
The text is valid Base64, but the decoded content is not a well-formed PDF Error "Incompatible file type: the decoded content is not a valid PDF." The destination file is not generated.
The destination file could not be written (invalid path, no permissions, etc.) Error Message describing the write problem.
Last update: 2026 | © GeneXus. All rights reserved. GeneXus Powered by Globant