Error trying to save a .doc to a pdf file

Hi,

At my recommendation my company recently purchased aspose.word and aspose.pdf.

*********************************************************************

When I try to generate a .pdf file from a .doc file I get the following error.

An exception of type 'Aspose.Pdf.Exceptions.InvalidPdfFileFormatException' occurred in Aspose.Pdf.DLL but was not handled in user code

Additional information: Startxref not found

************************************************************************

Here is the code I use in my aspx.cs file: -- btw doc.saveToPdf does not come up in intellisense

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(DocLocation);

try

{

doc.Save(PdfLocation + PdfName + ".pdf");

}

catch (Exception ex)

{

string error = ex.Message;

}

Thanks for any help

Dave Gatchell

Hi Dave,

Thanks for your interest in our products.

You can achieve this functionality using Aspose.Words for .NET. Kindly visit How to Convert a Document to PDF for more details and code snippets as per your requirement.

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

Hi Dave,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. We are unable to reproduce the issue at our side, while using latest version of Aspose.Words i.e. v11.5.0. Please check following code for the reference. Hopefully it will serve your purpose. Please feel free to contact us for any further query.

public static void docxtopdf()

{

Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "test.doc");

try {

doc.Save(MyDir + "Testpdf out.pdf", SaveFormat.Pdf);

}

catch(Exception ex)

{

string error = ex.Message;

}

}

Sorry for the inconvenience faced.

Best Regards,

Hi,I have the same problem too. I'm trying to convert a doc file to pdf using the aspose.pdf-new-4.0.0.jar.The error I get is :

Exception in thread "main" com.aspose.pdf.exceptions.InvalidPdfFileFormatException: Startxref not found

at com.aspose.pdf.engine.g.i.i(Unknown Source)

at com.aspose.pdf.engine.g.i.(Unknown Source)

at com.aspose.pdf.engine.g.i.(Unknown Source)

at com.aspose.pdf.engine.c.a.d(Unknown Source)

at com.aspose.pdf.engine.g.j.(Unknown Source)

at com.aspose.pdf.engine.c.a.e(Unknown Source)

at com.aspose.pdf.engine.d.(Unknown Source)

at com.aspose.pdf.Document.a(Unknown Source)

at com.aspose.pdf.Document.(Unknown Source)

at com.ust.aspose.pdf.CreatePdf.main(CreatePdf.java:10)

Any help on the issue would be appreciated. I'm doing a POC to see if Aspose can be used in an upcoming project.

Thanks,

SS

Hi Sachin,


Thanks for your interest in Aspose products. Just to clarify a little, please use Aspose.Words for .NET to be able to convert a Word document such as DOC to PDF format. Here is how you can achieve this:
http://www.aspose.com/docs/display/wordsnet/How+to++Convert+a+Document+to+PDF

Regarding your Aspose.Pdf related issues, I am moving your thread in Aspose.Pdf forum. My colleagues from Aspose.Pdf team will answer you shortly.

Best regards,

sachinUtc:
Hi,I have the same problem too. I’m trying to convert a doc file to pdf using the aspose.pdf-new-4.0.0.jar.The error I get is :

Exception in thread “main” com.aspose.pdf.exceptions.InvalidPdfFileFormatException: Startxref not found

Hi Sachin,


Thanks for your interest in our products.


The reason you are getting InvalidPdfFileFormatException is because you are trying to convert DOC file to PDF format using Aspose.Pdf for Java. Please note that Aspose.Pdf for Java supports the feature to create PDF file from scratch or you can use the same component to manipulate existing PDF file. Furthermore, as shared my Awais, Aspose.Words for Java provides the capability to convert DOC file to PDF format.


We do have a plan to support PDF to DOC conversion feature in Aspose.Pdf for Java and I am afraid this feature is currently not supported. The feature requested is logged in our issue tracking system as PDFNEWJAVA-33309. As soon as the feature becomes available, we would be more than happy to update you with the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.