I'm having an issue when exporting to PDF that the PDF is converting everything back to Times New Roman. Also, if saved as a docx the font is Times New Roman. However, the original docx is set to Arial.
I added code like this to reset the font on the run although for large documents this can't seem like the correct way to do it:
For Each r As Aspose.Words.Run In masterDocument.GetChildNodes(NodeType.Run, True)
r.Font.Name = "Arial"
Next
I have the following to return an output stream to me. What am I missing?
Using outStream As New System.IO.MemoryStream
Dim opts As New Saving.PdfSaveOptions
Dim encrypt As New Aspose.Words.Saving.PdfEncryptionDetails("", Guid.NewGuid.ToString, Saving.PdfEncryptionAlgorithm.RC4_40)
encrypt.Permissions = Saving.
PdfPermissions.DisallowAll
encrypt.Permissions = Saving.
PdfPermissions.Printing Or Saving.PdfPermissions.HighResolutionPrinting
opts.EncryptionDetails = encrypt
opts.PrettyFormat =
True
masterDocument.Save(outStream,
SaveFormat.Pdf)
Return outStream.ToArray
End Using
Using outStream As New System.IO.MemoryStream
Dim opts As New Saving.PdfSaveOptions
Dim encrypt As New Aspose.Words.Saving.PdfEncryptionDetails("", Guid.NewGuid.ToString, Saving.PdfEncryptionAlgorithm.RC4_40)
encrypt.Permissions = Saving.
PdfPermissions.DisallowAll
encrypt.Permissions = Saving.
PdfPermissions.Printing Or Saving.PdfPermissions.HighResolutionPrinting
opts.EncryptionDetails = encrypt
opts.PrettyFormat =
True
masterDocument.Save(outStream,
opts)
Return outStream.ToArray
End Using