Receving response and saving in pdf format but the pdf is showing cant able to open

From my server i am sending string buffer and receving here content type in pdf and saving the file but the pdf is not opening

Hey @kalyan

Welcome to the community! :wave:

Would you be able to expand on the details and walkthrough what you’re trying to do please?

Any answers would be just guesses based on the information you have provided, let’s get you a better response by explaining the problem in greater detail. :trophy:

In my server program i am writing like this:-if(cgi_get_varval(buffer,“download”,cgi_data,sizeof(cgi_data))==1)
{
if(strcmp(cgi_data,“true”)==0)
{ char file_buf[300];
sprintf(file_buf,"%s",“abcdef”);
response.content_type = HTTPSRV_CONTENT_TYPE_PDF;
response.data = file_buf; //buf;//cgi_data;
response.data_length = strlen(file_buf);
response.content_length = response.data_length;

			        HTTPSRV_cgi_write(&response);
		}}

And postman is my client in that i am receving in text format and preview also i am able to see in text format but i want to see in pdf format but it is not showing in that format.and i am downloading the reponse in pdf format but it is not able to open.
why? and how to resolve this issue? what is the correct format for the pdf file?

I might be wrong but I don’t believe it’s going to do that, the download and save option would be just creating a file based on that text response. It doesn’t really done a PDF type conversion.

A similar question was asked before and the thread show a could of way to do this - my method was to use Newman as a library with the node “fs” module to capture that response body and save that as a PDF.

Might not be what you’re after but you would be able to do what you’re trying to do with the Postman app.

Thank you for the response…Seen this but not able understand clearly…my doubt was what could be the reason that i am not able to open my pdf file after downloading from the postman?


In preview i am able to see in text format instead of pdf format.

You’re not downloading the ‘preview’ you’re downloading what the raw response to that request is though.

Exactly Now i want that text to be stored in pdf file …but it is not happening.

Like what are the headers to be added for the pdf file?

That’s not really how that works, just adding a header to something in the app doesn’t magically change the output…unless the API has been implemented that way. :joy:

I can only see that happening if the response returns something that uses content-type:application/pdf.

I would explore using Newman and the ways mentioned in that other thread to do this.

Unless I’m wrong about the way save and download works and someone can explain how it can be done that way so that any response body can be converted to a PDF. I love learning new things :trophy:

Hi @kalyan,

@dannydainton sums things up pretty well.

The best way to do this would be to obtain your response, and convert it to pdf format. Anything you get in the response is raw, as noted by Danny. Whatever form of raw data, at the end of the day its the most basic format, some raw form of bytes that are string representable (could get buffer bytes, but I wont go there).

I am not sure if you control the server, but if you do, you would need to program the response to return a pdf encoded version of what you want to send out.

So for example string ‘abcdefg’ does not automatically translate to a pdf, its just a string.

You want to first encode that string into a pdf format. That will make it viewable in pdf. Next, you would encode the pdf content, into a base64 string, as this format will not conflict with any HTTP formatting.

Then on the client side, you would decode the base64 string, to then get an encoded pdf, which any pdf client should be able to read.

In order to create the pdf in the first place, you would need to use a library that can encode/create pdfs, which there are plenty out there (depending on your language of choice).

Now, doing this all client side within Postman is not possible that I know of. As there is no Postman node.js library available in the sandbox available to create pdf files. Only then could you create a pdf file (if your backend server does not create pdf files).

So, just to show you, this is a raw, base64 encoded pdf file that says “hello world” in it. Decode it here and see what you get. https://www.ipvoid.com/base64-to-pdf/

JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAFVj8EOgjAMhu88xe9ND0I3N+auGqNXkiY8wASJGRLY+yeuciCmh/5N/35tZzSY4TRqb0prTh6mPkPb0tiaHJYOLT6o7knhlVBdcw4J6hcpyKDThBHWUCEqitpg8Q8dMaAXiBYIIQMyWQt5BpXeeXLe5gbhuJXrjiKMuHB2EZECByi1GnO2UAQeUTHLZdxj/+hinNBOS3zuDuA3bpw/bb72uzYYCmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iagoxNjUKZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAzIDAgUiAvUmVzb3VyY2VzIDYgMCBSIC9Db250ZW50cyA0IDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXQo+PgplbmRvYmoKNiAwIG9iago8PCAvUHJvY1NldCBbIC9QREYgL1RleHQgXSAvQ29sb3JTcGFjZSA8PCAvQ3MyIDggMCBSIC9DczEgNyAwIFIgPj4gL0V4dEdTdGF0ZQo8PCAvR3MxIDEwIDAgUiAvR3MyID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aWxlcgo8PCAvU2l6ZSAyMCAvUm9vdCAxNiAwIFIgL0luZm8gMSAwIFIgL0lEIFsgPGJiOTk4ODRlNDJkNDYwYjU4ZGFmM2VlOGViMjNmNDFiPgo8YmI5OTg4NGU0MmQ0NjBiNThkYWYzZWU4ZWIyM2Y0MWI+IF0gPj4Kc3RhcnR4cmVmCjExMzE0CiUlRU9GCg==

Clearly, there is a lot of metadata in there to make it a pdf file.

So basically, you’re limited to getting the response back with this type of format above, in order to then read it as a pdf.

Thank you for the useful information @dannydainton,@odanylewycz .