Get PDF from a base64 string

  1. last week

    Matteo L

    Jul 10 Pre-Release Testers Europe (Montebelluna (TV), Ita...

    Hello! i have a Base64 encoded string that i need to convert to PDF for printing (something like this service https://base64.guru/converter/decode/pdf).
    Is there a way to do it in xojo?

    Thanks!

  2. Dave S

    Jul 10 San Diego, California USA

    The data that is IN the BASE64 string is not already formatted PDF data?
    and you wish to decode the string, and convert to PDF?

    The will take something like my gPDF class (or something similar)

  3. Karen A

    Jul 10 Pre-Release Testers
    Edited last week

    @Matteo L Hello! i have a Base64 encoded string that i need to convert to PDF for printing (something like this service https://base64.guru/converter/decode/pdf).
    Is there a way to do it in xojo?

    Thanks!

    You can decade BASE 64 in Xojo
    https://docs.xojo.com/DecodeBase64

    and that should just be a A PDF that you can save to disk and open/print with any PDF reader

    - karen

  4. Dave S

    Jul 10 San Diego, California USA
    Edited last week

    The unanswered question is if the "string" is already in PDF format or not..... the way I read his question it isn't

    However the website he cited, does require the BASE64 string to be a valid PDF data

  5. Emile S

    Jul 10 Europe (France, Strasbourg)

    In MacOS and Windows (8.1 / 10), you can print data* to pdf. I do not know if this is also built-in Linux.

    * Place the data to print in a TextArea, then print it to PDF using the virtual printer (both platforms).

  6. Matteo L

    Jul 10 Pre-Release Testers Europe (Montebelluna (TV), Ita...

    @Dave S The unanswered question is if the "string" is already in PDF format or not..... the way I read his question it isn't

    However the website he cited, does require the BASE64 string to be a valid PDF data

    It think it's already a PDF as the web service works correctly with it.

    i'll look at you class and at the function that @Karen A has suggested.

    Thanks a lot guys!

  7. Alberto D

    Jul 10 Pre-Release Testers

    I guess the base64 file is from a PDF, I saw this on that page:

    Important notes about the decoder
    The “Base64 to PDF” converter will force the decoding result to be displayed as a PDF file, even if it is a different file type. Therefore, if you are not sure that your Base64 string is a PDF, use the Base64 to file converter since it is capable of displaying various file types. In any case, feel free to give it a try, since this converter will inform you if something is wrong.

or Sign Up to reply!