FormatAsposePdf - Invalid file format requested


#1

Hi!
I’m trying to save word doc into xml for AsposePdf component.
On Aspose.Word.Demos.Web sample change just a save format like this:

mergeDoc.Save(“PersonalizedLetter.doc”,
SaveFormat.FormatAsposePdf,
(saveTypeBtn.SelectedIndex == 0) ? SaveType.OpenInBrowser : SaveType.OpenInWord,
this.Response);

and getting the next error:

System.ArgumentException: Invalid file format requested.

The version of AsposeWord is 1.3 .

Any ideas?

thanks!
Dobrisa Adamec


#2

Hi Dobrisa,

Saving Word documents in PDF format has not been fully implemented yet. SaveFormat.FormatAsposePdf enumeration was added in one of the beta releases and made its way to the final release too early.
Sorry for the inconvenience.
Aspose.Word will support saving documents in PDF format in the future.


#3

Hi!
SaveFormat.FormatAsposePdf saves document in xml format. Like it says in documentation ("
Saves document in Aspose.Pdf.Xml format that can be read by Aspose.Pdf to produce Pdf file.
"). I manage to save it and it works just fine. But now need a help with opening that XML file with Aspose.Pdf. What method should I use. I seames that BindXml is not for that kind of files.
Is there a way to open those files in Aspose.Pdf.


Thanks!
Dobrisa Adamec


#4

Aspose.Word does not support save in PDF format yet.


#5

And when should we expect this feature? We DO need it soon:)

Or may be you have any advice for us:

We have source templates in .doc format and we need to do some changes in a file (replacing marks and inserting some new paragraphs) and we need to send to the end used output in PDF. How can we manage that with your components?

Thank you.


#6

Hi,

Thank you for your interest in Aspose products.

We are working hard on exactly this feature. You can help by emailing some of your templates to word@aspose.com. This way we will ensure that any features you use in your documents are supported. Check back in a month or so, but there is no fixed delivery date yet.


#7

Hi Roman,

I have shifted onto another thread as I am now looking for functionality to output to PDF.

I downloaded Aspose.Pdf which does not offer functionality to use a word document as a template, is this correct?

I then had a hunt around on your forums, and came across this thread.

The functionality you are currently working on sounds as if it will allow the user to output to PDF from Aspose.Word, is this correct?

Once this is implemented, will the functionality require Aspose.Pdf to run, or will it be stand alone in Aspose.Word?

I don’t mean to sound annoying, but do you know yet when this functionality will be avaliable.

Thanks,
Rich.


#8

Hi Rich,

The plans on Word->Pdf conversion changed around a few times because of research and experiments and high demand for other features.

Only one thing is clear: Aspose.Word will be able to produce Pdf files soon.

The latest plan is Aspose.Word will produce files in Aspose.Pdf.Xml format and you will be able to feed this file into Aspose.Pdf to get Pdf output. New estimated delivery date is end of June. Most of the document features will be supported, but not all (we don’t know exactly which ones yet).


#9

Hi,

Latest Aspose.Word 1.6 can be used together with Aspose.Pdf to convert DOC files to PDF.


#10

Hi Roman,

I have output an XML document from Aspose.Word ready for input into Aspose.PDF using…

docOutput.Save(“OutputDoc.xml”, SaveFormat.FormatAsposePdf);

I then try to get PDF output through Aspose.PDF using…

Pdf app = new Pdf();

app.BindXML(“OutputDoc.xml”, null);

app.Save(“OutputDoc.pdf”);

The code loses focus on app.save.

The same code works fine using a very simple XML document for input, so I think it is having issues with some of the formatting commands ind the XML doc output by Aspose.Word.

Am I missing code I need to interpret the XML document correctly?

Thanks,
Rich.


#11

You do everything correctly. Please email your .doc file to me to word@aspose.com.


#12
Hi Roman,
Thanks for you fast response, yet again!
I have emailed you my XML document and .png file output by Aspose.Word.
I have also emailed you EQT.cs which is the C# I am using to produce both the word and pdf outputs.
You will notice private void btnRunWord_Click refers to Aspose.Word generation and private void btnRunPDF_Click refers to PDF generation.
Thanks,
Rich.

#13

Hi Rich, I’d like to get the .doc file please.


#14
Roman,
As requested, I have emailed you the Word template, XML document, and output document for Aspose.Word.
Thanks,
Rich.

#15

The problem seems to be in Aspose.Pdf. I will pass the file to them so they can address it asap.


#16

Dear Rich,

Thank you for considering Aspose.

I have fixed the bug in Aspose.Pdf. Please download hotfix here.