Free Support Forum - aspose.com

Problem with Rendering to PDF

Aspose Team,

I am using Aspose.Words version 6.3.0.0. I am taking a template document and mergering data into it and producing another .doc file. Then I take the newly created file and render it to a pdf document. The merged file looks fine but the pdf document has the following problems...
1. Address in the top right hand corner does not have the carriage return breaks, might be a smart tag issue.
2. Contents on the second page are appearing at the bottom of the 1st page.

Attached are the documents for your review.

Thanks.

Hi

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

Thanks for your request.

1. Yes, you are right, the problem occurs because there are SmartTags. I linked your request to the appropriate issue. As a workaround, you can remove SmartTags from the document before converting the document to PDF. Here is the code:

Document doc = new Document(@"Test106\3007NBV03TPL_1_Merged.doc");

RemoveSmartTags(doc);

doc.SaveToPdf(@"Test106\out.pdf");

============================================================================

///

/// Removes all SmartTag nodes from the docuemnt, preserving content

///

/// Input document

private void RemoveSmartTags(Document doc)

{

//Get collection of SmartTags from the document

NodeCollection nodes = doc.GetChildNodes(NodeType.SmartTag, true, true);

//Loop while there is SmartTags in the document

while (nodes.Count > 0)

{

SmartTag tag = (SmartTag)nodes[0];

//Get parent node of smartTag.

//we should move all content from smatrTag to its parent to preserve documents content

CompositeNode parent = tag.ParentNode;

//Loop throuht all nodes inside smartTag and move its convent to parent node

while (tag.HasChildNodes)

parent.InsertBefore(tag.FirstChild, tag);

//Remove smartTag

tag.Remove();

}

}

2. The second problem occurs because your table is floating. Aspose.Words does not fully support positioning of floating tables. I linked your request to the appropriate issue. As a workaround, you can use inline table.

Best regards.

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


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

The issues you have found earlier (filed as WORDSNET-1940) have been fixed in this .NET update and in this Java update.


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