We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Blank PDF generated from .DOCX with CustomXMLBlock

The attached document is a template used to generate letters. It begins with a “NewDataSet” tag which is a CustomXmlBlock behind-the-scenes. Here is its reference from the OpenXML reflector:

CustomXmlBlock customXmlBlock1 = new CustomXmlBlock(){ Uri = "http://Claim.org/XMLSchema.xsd", Element = "NewDataSet" };

Whenever this first “NewDataSet” tag is present, Aspose genereates blank documents. Whether we try to convert it to a .doc, .pdf, or anything. Even if we just open it and save it back to a .docx it becomes empty.
If we remove the “NewDataSet” tag then the document works fine. Aspose.Words is able to convert it to a PDF just fine as long as this tag is not at the beginning. It will also generate a pdf with any text that is outside the “NewDataSet” tag.
We were wondering if you could shed any light on this.

Hi
Thanks for your request. But it seems I cannot reproduce the problem on my side. I used the latest version of Aspose.Words for testing. You can download the latest version from here:
https://releases.aspose.com/words/net
Best regards,

I downloaded the 10.3 version, installed, and updated my reference inside my project and I’m having the same issue. I get a blank PDF. I am getting the “Eval” notice in red but I know this is to be expected until we buy our license.
Just to be sure, here is the code I’m using to convert the file:

Aspose.Words.Document doc = new Aspose.Words.Document(directory + "\\" + fileToConvert);
doc.Save(directory + "\\" + fileToConvert.Replace(".docx", ".pdf"));

So you are saying that when you do essentially that same thing, the PDF comes out fine?
I attached the PDF I am getting when I run the same exact file I sent you through my project with the code above.
Thank you for your help.

Hi
Thank you for additional information. You use Aspose.Words in evaluation mode and document is truncated. There is evaluation limitation of maximum number of paragraphs in the document. You can see the following text in the output documents.
This document was truncated here because it was created using Aspose.Words in Evaluation Mode.
If you want to test Aspose.Words for without the evaluation version limitations, you can request a 30-day Temporary License. Please refer to
https://purchase.aspose.com/temporary-license
Best regards.