Using pdfApi.PutCreateDocument

Hi,

I am using PdfApi.PutCreateDocument in order to convert and store pdf.

I cant find what are the template type allowed to send to the method.

I would like to send the next file types: docx, doc, pptx, ppt, xlsx, xls, jpeg, png.

Thanks.

@sarahshulman,
The template types XML, HTML, PCL, TIFF, JPEG, SVG, and XPS can be used. Aspose.Pdf API cannot generate PDF from DOCX, DOC, PPTX, PPT, XLSX, XLS and PNG templates. We have separate APIs to read other formats like:

  1. Aspose.Words API can read Word documents (DOC/DOCX).
  2. Aspose.Slides API can read PowerPoint presentations (PPT/PPTX).
  3. Aspose.Cells API can read Excel Workbooks (XLS/XLSX).
  4. Aspose.Imaging API can read PNG.

Please let us know in case of any confusion or questions.

Best Regards,
Imran Rafique

Is there support to save on the cloud for word, power pointer etc. files?

How do I do that?

@sarahshulman,
You can convert the Word, PowerPoint and Excel documents to PDF on the cloud with Aspose.Words for Cloud, Aspose.Slides for Cloud and Aspose.Cells for Cloud APIs respectively. Please refer to these help topics: Converting a Word document to other supported formats, Convert Excel Workbook to Different File Formats and Convert PowerPoint Documents to other File Formats

Best Regards,
Imran Rafique

@sarahshulman,

You can also use our swagger link to test Cloud APIs functionality. Please follow below steps to test the Cloud APIs functionality

1- Open URL PutCreateDocument
2- Enter your App Key and App Sid in right top corner
3- Enter required parameters like version 1.1 and template type
4- Click Try it out button
5- It will return you Request URL with correct signature at the end and Response Body

If you have any further questions, please feel free to share.

Thanks,

Naeem Akram

Thank You!

It is all working now - except the convert from PNG to PDF - I have tried to use the:

imagingApi.PostImageSaveAs(“pdf”, pdfFileName, fileAsBytesForImaging);

But it fails.

Also, Is there an opion to use fileName stored in the cloud rather then a stream?

@sarahshulman,

Thank you for contacting support.

Aspose.Imaging support bmp, png, jpg, tiff, psd and gif formats. For valid formats, please visit link Export to another format.

You have to pass image as request body rather than fileName stored in the cloud.

If you have any further questions, please feel free to share.

Thanks,
Naeem Akram

Is there a way to convert the png image to pdf?

why the imaging working only with a stream and not with a file name like all the other aspose to cloud work?

Thank you,
Sarah.

@sarahshulman

I am afraid currently Aspose.Pdf for Cloud API does not provide create PDF from PNG functionality. I have logged an enhancement ticket in our issue tracking system as PDFCLOUD-50.

You will be notified via this forum thread once this feature is added in our new release. However, please note that it will not be available in short time.

For now, please follow below steps to create PDF from PNG

1- Use Aspose.Imaging for Cloud API to convert PNG format to JPG using [Convert Image Format] functionality
2- Use this JPG image to create PDF using [Create PDF from JPEG] functionality of Aspose.Pdf for Cloud

Every API URI have own specification’s and currently imaging only work with stream.

If you have any further questions, please feel free to share.

Thanks,

Naeem Akram