I'm trying to convert a .pdf
file to .docx
using Aspose.Cloud
.
It converts other formats like word or text to PDF fairly easily, but I'm having trouble converting a .pdf file to any other format.
I have also tried the Aspose.Pdf
service, but that only allows you to convert to/from a physical path (D/myfile.pdf
). I want to be able to do this within the storage itself (azure blob), i.e. Pick a file from one container (pdfcontainer) -- convert to docx -- store to doccontainer.
I've tried the ConvertDocument
and ConvertToSomeFormat
methods exposed by the PDFService
class. I'm also converting documents of other formats like doc, txt to PDF using the ConvertDocument
method of the WordsService
class and this converts the documents and saves it successfully. But ConvertToSomeFormat
doesn't save the file to the specified container. I get a "404 not found" error while trying to retrieve the file.
Converting docx/txt to PDF - This works!
WordsService wordService = new WordsService("myAppId", "myAppKey");
wordsService.ConvertDocument(convertFromFile, WordOutputFormat.Pdf, convertFromContainer, convertToContainer + "/" + targetFilename, asposeStorageName);
Converting PDF to docx - Doesn't work!
PDFService pdfService = new PDFService("myAppId", "myAppKey");
pdfService.ConvertToSomeFormat(convertFromFile, PDFDocumentConvertFormat.Doc, convertToContainer, convertToContainer + "/" + targetFilename, asposeStorageName);