PDA

View Full Version : Error: You must rely on system font, Adobe 10, windows 7, Office 2010



johnj
10-02-2014, 06:40 PM
Hi there

I have this simple code which basically trying to converts Sheets in the current excel file to PDF with the help of PS file



Sub Convert(Current As Worksheet)
Dim currect As Worksheet
Dim myPDF As PdfDistiller
Dim PSFileName As String
Dim PDFFileName As String
If InStr(Current.Name, "ID") = 1 Then
PSFileName = "C:\Users\Public\Tool\PDF\" & Current.Range("b4").Value & Current.Range("b3").Value & ".ps"
PDFFileName = "C:\Users\Public\Tool\PDF\" & Current.Range("b4").Value & Current.Range("b3").Value & ".pdf"
If InStr(PSFileName, "/") Then
PSFileName = "C:\Users\Public\Tool\PDF\" & Current.Range("b3").Value & ".ps"
11.PDFFileName = "C:\Users\Public\Tool\PDF\" & Current.Range("b3").Value & ".pdf"

Else
End If
Application.CutCopyMode = False
Current.PrintOut copies:=1, preview:=False, ActivePrinter:= _
"Acrobat Distiller", printtofile:=True, Collate:=False, prtofilename:=PSFileName


'MsgBox "PSFileName : " & PSFileName
'MsgBox "PDFFileName : " & PDFFileName
' Convert the postscript file to .pdf
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

End If
End Sub

Now I kept getting this error
"When you create a PostScript file you must rely on system fonts and use document fonts"


From other posts I tried the following steps


Click the Start menu, and then click Devices and Printers
Right-click the Adobe PDF printer, then click Printing Preferences, and then deselect Rely on system fonts only; do not use document fonts
Click OK
Right-click the Adobe PDF printer, then click Printer Properties, then click the Advanced tab, and then click Printing Defaults
On the Adobe PDF Settings tab, deselect Rely on system fonts only; do not use document fonts, and then click OK.
On the Adobe PDF Properties dialog, click OK


I still get the error, every time I am running the macro. I am on Adobe 10, windows 7, Office 2010, any suggestions?

Jan Karel Pieterse
10-03-2014, 12:54 AM
Why are you not using the ExportAsFixedFormat feature of Excel?

johnj
10-05-2014, 05:28 PM
Hi Jan

That is exactly what I did and it works:


Dim CurrentSheet As String
CurrentSheet = Current.Name

ThisWorkbook.Sheets(Array(CurrentSheet)).Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\Public\temp.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False


Thanks

Jan Karel Pieterse
10-06-2014, 01:00 AM
Can't that be shortened to:


Current.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\Users\Public\temp.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False

Aussiebear
10-06-2014, 02:11 AM
Just goes to show that sometimes we can't see the forest for the trees...... JohnJ, we are all guilty of it from time to time but thank you for sharing this learning experience with the rest of us mere mortals.