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:
'''
''' Inserts content of the external document after the specified node.
''' Section breaks and section formatting of the inserted document are ignored.
'''
''' Node in the destination document after which the content
''' should be inserted. This node should be a block level node (paragraph or table).
''' The document to insert.
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?
Hi
Thanks for your request. Could you please also attach your original Word document here for testing? I will check the issue and provide you more information.
Best regards,
Hi
Thank you for additional information. Please make sure that Wingdings 2 font is installed on the PC where you perform conversion to PDF. If not, please try to install Wingdings2 font. This should fix the problem. Please let me know in case of any issues.
Best regards,
Hi
Thank you for additional information. If you try comparing your PDF documents (Right.pdf and Wrong.pdf) you will see that the Wrong.pdf document does not contain Wingdings 2 font embedded. (Please see the attached screenshot) The only reason of this - it is Wingdings 2 is no installed on the PS where this document was generated. As a variant you can try remove/add this font for testing.
Best regards,
Well I’m definitely confused about this. I logged into the server and tried to install Wingdings2 and got the message in the attached doc file. It’s telling me it’s already installed.
Hello
Thank you for additional information. Which version of Wingdings 2 font you are using? My version is 1.55.
The document produced on my side looks fine. I use the latest version of Aspose.Words 10.3.0 and the following code for testing:
Document doc = new Document("C:\\Temp\\Original.doc");
doc.Save("C:\\Temp\\out.pdf");
Hi
Thanks for your request. To check version of the Aspose.Words library, right click on the dll, select Properties from the context menu, then select Version tab. You will see File version.
To check version of the font just open it and you will see the version. Please see the attached screenshot.
Best regards,
Hi
Thanks for your inquiry. Could you please try using the latest version and let me know how it goes on your side?
The latest version you can download here: https://releases.aspose.com/words/net
Best regards,
Hi
Thank you for additional information. But I still cannot reproduce the problem on my side. The document produced on my side looks fine. Have you tried converting the document which causes the problem on other machine with Wingdings 2 font installed, maybe something wrong with your server or font?
Bets regards,
Andrey, it turns out that the web service calling my code is on a different server than the one I had been checking. Wingdings2 has now been installed on the correct server and the output PDFs now look normal. Thank you so much for your help and sorry I didn’t figure out my mistake sooner!