Options

Sending PDF in NAV2017

AitorEGAitorEG Member Posts: 342
Hi everyone,

I need to publish a webService in NAV2017. This webService will receive a posted sales invoice number, and need to return the invoice in a PDF format. is this possible? A time ago, I read something about converting the PDF into base64, but now I cannot find any info about it.

Any hint to solve this issue?

Thank you very much

Best Answer

Answers

  • Options
    AitorEGAitorEG Member Posts: 342
    Wisa123 wrote: »
    To achieve this you want to print the report in Memory to a OutStream. Pseudocode
    //obtain recref
    TempBlob.Blob.CreateOutStream(PdfOutstream);
            if not report.SaveAs(ReportId, '', ReportFormat::Pdf, PdfOutstream, RecRef) then
                Error(GetLastErrorText());
    

    at least in NAV2018 the Tempblob Table has a ToBase64String() procedure that alows you to receive the textstring you are looking for.

    Thank you. I'll work on it!
Sign In or Register to comment.