Free Support Forum - aspose.cloud

Convert JPEG to PDF with image size and orientation using Aspose.PDF REST API

Hi all


I tried to create a pdf from an image with the Aspose.Pdf for Cloud method “create PDF from JPEG”. This worked, but the image was turned by 90° and resized, at the PDF I had a white frame around the image.

What do I have to do to make the PDF page the size of the picture and proper orientation?

Regards,
Matthias

Hi Matthias,


Thanks for your inquriy. Please share your sample PDF and output JPEG image here, we will look into it and will guide you accordingly.

We are sorry for the inconvenience.

Best Regards,

Hi Tilal


Please find the requested files attached. The file 1.jpg is the source file, the file 1.pdf the result. To do so I use the following PUT request:

http://api.aspose.com/v1.1/pdf/1.pdf?storage=MyStorage&folder=MyFolder&templateFile=MyFolder//1.jpg&templateType=jpeg

What I need is a PDF outcome with exactly the size of the image and proper orientation.

Best regards,
Matthias

Hi Matthias,


Thanks for sharing your sample documents. I have tested JPEG to PDF conversion with your shared image file using REST API sample code form the documentation link and unable to notice the orientation issue. Please use that code, it will generate PDF document with proper orientation.

However, currently Aspose.Pdf for Clouds does not support to set page size during Image to PDF conversion, so I have logged a ticket PDFCLOUD-33 to set Page size/margins to get PDF of exact size of the image. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

Hi Tilal


Thank you for your support. It’s some kind of strange that you get a different result in the PDF. I followed the documentation you have mentioned but can’t find any difference when I compare the URI used there with my own. Any idea what I could have done wrong?

However, I have to wait anyway until the resize feature would be available. Can you already give an estimation, when this would be?

Best regards,
Matthias
Hi Matthias,

matthias.bickel:

Thank you for your support. It's some kind of strange that you get a different result in the PDF. I followed the documentation you have mentioned but can't find any difference when I compare the URI used there with my own. Any idea what I could have done wrong?


Thanks for your feedback. I am investigating it and will update you soon.

matthias.bickel:

However, I have to wait anyway until the resize feature would be available. Can you already give an estimation, when this would be?


I am afraid we can not share any estimation at the moment, as we have recently logged the requirements. We will be in a good position to share any timeline, as soon as the investigation of the issue is completed. We will keep you updated about the issue resolution.

We are sorry for the inconvenience.

Best Regards,

Hi Matthias,


matthias.bickel:

Thank you for your support. It’s some kind of strange that you get a different result in the PDF. I followed the documentation you have mentioned but can’t find any difference when I compare the URI used there with my own. Any idea what I could have done wrong?


I have again tested the scenario and unable to replicate the orientation issue. For further investigation we need your complete sample code along with APPSID and APPKEY via email as suggested here.

We are sorry for the inconvenience.

Best Regards,