社区
我写了段程序 通过inventor2024中 使用软件自带的PDF文件导出功能 将工程图转为PDF。但是会字体被替换。请问有什么好的方式解决吗?(可以将字体内嵌到pdf中,或者可以指定用哪款字体进行替换)
已解决! 转到解答。
由 taiyixvjing 解答. 转到解答。
感谢大佬提供的思路,已下是修改好的程序,有需要的同志可以参考下
Sub Main() ' 检查当前文档是否为工程图文档 If ThisApplication.ActiveDocument.DocumentType <> kDrawingDocumentObject Then MsgBox("This is not a drawing document.") Exit Sub End If Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oPrintMgr As PrintManager oPrintMgr = oDoc.PrintManager ' 设置打印机为Microsoft Print to PDF oPrintMgr.Printer = "Microsoft Print to PDF" ' 设置打印范围为所有图纸 oPrintMgr.PrintRange = kPrintAllSheets ' 设置比例为最佳比例 oPrintMgr.ScaleMode = kPrintBestFitScale ' 不使用全黑打印 oPrintMgr.AllColorsAsBlack = False ' 构建PDF文件的完整路径 Dim strPDFFileName As String strPDFFileName = ThisDoc.PathAndFileName(False) & ".pdf" ' 提交打印任务 oPrintMgr.PrintToFile(strPDFFileName) End Sub