Hi.
I’m testing the Aspose.Word and Aspose.Pdf products for conversion between the two formats.
I can load the Doc, and export to XML, but when i try to Bind the XML to the new Pdf document, i get the following System.IO.Exception:
"The path is too long after being fully qualified. Make sure path is less than 260 characters."
I’ve attached the original Doc so you can try to duplicate the problem…
Dear seramend,
Thank you for considering Aspose.
I can’t reproduce this error. Can you please post your code here? Please also tell me the path of the xml.
Here’s the code i’m using :
Document wordObj = new Document(@“D:\Projects\EPMon\Análise\Caderno de Encargos.doc”);
wordObj.Save(@“d:\Encargos.xml”, SaveFormat.FormatAsposePdf);
FileStream fs = new FileStream(@“D:\Encargos.pdf”, FileMode.Create);
Pdf pdfObj = new Pdf(fs);
StreamReader tr = new StreamReader(@“D:\Encargos.xml”);
string xml = tr.ReadToEnd();
pdfObj.BindXML(xml, null);
pdfObj.Close();
The solution for the project i’m trying this on is on
“D:\Projects\Testes\AsposeTest”,
so the binaries would be on
"D:\Projects\Testes\AsposeTest\bin\Debug"
as you can see, i tried shortening the directory of the xml file to the shortest one possible, but still i would get the same error.
Sérgio
Dear Sérgio,
Thank you for considering Aspose.Pdf.
As you can see in Writing Pdf directly, some advanced features such as hyperlinks are not supported in Direct-to-File mode. So please use normal mode to convert Word to Pdf.
Please also note that the first parameter of BindXML is the XML file path but not the content of the XML.
Thanks. I’ve at least got it working now, with simpler Docs.
I knew it had to be something really simpler.
Sérgio
Ok. Different problem.
I’ve corrected the path problem, and created a new word document (Using Word 2003), and wrote the word “test” in it. (Simplest test there is, huh?)
The resulting PDF has the text “Se$1,S’6=test” on it. I know i’m using the “demo” version of the software, but somehow that doesn’t seem like it ought to be happening. I’ve included the original doc for you to try and replicate the problem
I have tested it and found no error. The garbage characters are part of the watermark of Aspose.Word.