Hello,
I've got an issue when importing a Word doc into a pdf that the checkbox controls from the source doc show up as circles/bullseyes when imported into the pdf. This happens on my test server, but not on my local dev machine. I'm using an InsertDocument method I found in these forums to do the importing:
''' <summary>
''' Inserts content of the external document after the specified node.
''' Section breaks and section formatting of the inserted document are ignored.
''' </summary>
''' <param name="insertAfterNode">Node in the destination document after which the content
''' should be inserted. This node should be a block level node (paragraph or table).</param>
''' <param name="srcDoc">The document to insert.</param>
Private Sub InsertDocument(ByVal insertAfterNode As Words.Node, ByVal srcDoc As Words.Document, ByVal HeaderText As String)
Dim lic As New Aspose.Words.License
lic.SetLicense("Aspose.Words.lic")
' Make sure that the node is either a pargraph or table.
If ((Not insertAfterNode.NodeType.Equals(Words.NodeType.Paragraph))) And ((Not insertAfterNode.NodeType.Equals(Words.NodeType.Table))) Then
Throw New ArgumentException("The destination node should be either a paragraph or table.")
End If
' We will be inserting into the parent of the destination paragraph.
Dim dstStory As Words.CompositeNode = insertAfterNode.ParentNode
' This object will be translating styles and lists during the import.
Dim importer As New Words.NodeImporter(srcDoc, insertAfterNode.Document, Words.ImportFormatMode.KeepSourceFormatting)
'add descriptive header
Dim builder As New Words.DocumentBuilder(srcDoc)
InsertSectionHeader(builder, HeaderText)
' Loop through all sections in the source document.
For Each srcSection As Words.Section In srcDoc.Sections
' Loop through all block level nodes (paragraphs and tables) in the body of the section.
For Each srcNode As Words.Node In srcSection.Body
' Let's skip the node if it is a last empty paragarph in a section.
If srcNode.NodeType.Equals(Words.NodeType.Paragraph) Then
Dim para As Words.Paragraph = CType(srcNode, Words.Paragraph)
If para.IsEndOfSection AndAlso (Not para.HasChildNodes) Then
Continue For
End If
End If
' This creates a clone of the node, suitable for insertion into the destination document.
Dim newNode As Words.Node = importer.ImportNode(srcNode, True)
' Insert new node after the reference node.
dstStory.InsertAfter(newNode, insertAfterNode)
insertAfterNode = newNode
Next srcNode
Next srcSection
End Sub
Could someone let me know why this might be happening? Does MS Office have to be installed on the server like it is on my dev machine?
I've attached two examples of the output pdf.
Thanks in advance.
Ben