90
Views
4
Comments
How to render a PDF file which I recived as a text stream?

I'm implementing a few functionalities of the Jasmin ERP (from Primavera BBS) in my project, more precisely I am inserting invoices into the ERP, and the call returns a response with a text stream which is supposed to be the pdf file (at leats that's what they say in their documentation).

My question here is if there is any way i can convert that text stream into the actual pdf file. 

Below is a file with an example of the text stream response.



invoiceresponseexample.txt
2021-04-17 09-53-48
José Gonçalves

Hi Maria,

there are many components in the forge to convert many formats to pdf (i.e. html page to pdf).

https://www.outsystems.com/forge/component-overview/209/html2pdfconverter

The file you sent doesn't look like a txt file. You need to find the proper format to convert to your pdf.

Regards

UserImage.jpg
Maria Lourenço

Hello José,

Thanks for the answer! So I've already been trying for a while to find what is the format of the file, but I'm not having much success. Do you have any tips as to how I can figure this out?

2021-04-17 09-53-48
José Gonçalves

I live almost next door from Primavera Headquarters so I could just knock and ask.. :D 

I changed the extension of the file to .pdf and it opens as a pdf... although blank. Can you try to change the extension from real files?

2021-03-16 19-50-12
Julio Iglesia

I believe that the call to ERP is returning a different MIMETYPE than the one you are taking as text. Don't forget that the best integration would be to call an API (or similar). You take it as a binary file. It could be converting it to base64 and then to binary, with Outsystems functions.

If it is with API, I suggest trying it with POSTMAN and then integrating it with Outsystems.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.