Docx -> Pdf with content controls

Hi,
I am trying to convert a docx file to pdf format. The docx file contains a number of content controls which display the data correctly in the docx file. However, when converted to pdf, the name of the content controls appear, rather than the actual data.
For example,
In the docx file: Person = Mr Joe Bloggs
In the pdf file: Person =
I am using something similar to the code below (comments etc stripped out). Am I doing something wrong here?

Document doc = DocumentLoader.Execute(InputFile);
MemoryStream xmlStream = new MemoryStream();
doc.Save(xmlStream, SaveFormat.AsposePdf);
xmlStream.Seek(0, SeekOrigin.Begin);
Pdf pdf = new Pdf();
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.BindXML(xmlStream, null);
pdf.IsTruetypeFontMapCached = false;
pdf.Save(OutputFile);

Hello John,
Thanks for considering Aspose.
Please try the following code line. Make sure you are using the latest version of Aspose.Pdf 3.8.0.0 and incase the issue still persists, please share the resource file with us.

Document doc = new Document(InputFile);

I am not sure how you are filling data in content controls. Are you using Mail Merge feature of Aspose.Words ? or any other technique.

Hi Nayyer,

Sorry, I should have clarified that the DocumentLoader.Execute(InputFile) method is an abstraction which returns new Document(InputFile);

The content controls are just data aware controls that read their contents from the xml contained in the docx file.

I’ve attached a sample file.

Thanks,

John

…and the docx file. Could only attach 1 file per post.

…and the docx file. Could only attache 1 file per post.

Hello John,
Thanks for clarifying. It would be more convenient for us, if you could share the complete project.
FYI: In order to attach more than one attachment, you can compress them in a single file and than share the zip file. Or you can add more than one file under Additional files section.

Hi Nayyer,

As requested, I have attached a zip file containing a small visual studio application which will read Sample.docx from the bin\debug directory, convert it to pdf format, and write it to Sample.pdf also in the bin\debug directory. The pdf will not contain the data associated with the content controls in the docx file.

Thanks,

John

Hello John,
I have tested the project that you have shared and have noticed the issue that you have specified. We are looking into the details of this issue, and soon will update you with the status of correction. We apologize for your inconvenience.

Hi John,

Thanks for your inquiry.
We render pdf according to the intermediate xml which is generated by Aspose.Words. In the xml, it seems that Aspose.Words just output the name of the content controls rather than the actual data. It should be fixed in Aspose.Words. I am moving this thread to aspose words forum so that they have the chance to look into this issue.

Best regards.

Hi
Thanks for your inquiry. Aspose.Words does not fully support Content Controls. This is known issue#1429 in our defect database.
Issue #1429 - Add support for Word 2007 content controls to the model
I will notify you as soon as it is fixed. But currently I can’t provide you any estimate.
Best regards.

The issues you have found earlier (filed as 1429) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.