Community,
Does anyone know how to programmatically set the option to "Capture fonts used in the drawing" for PDF files?
I have a LISP routine that creates a DXF and a PDF from a DWG.
;; PLOT TO PDF
;; plot settings
(setq
strOutDev "AutoCAD PDF (Smallest File).pc3"
strPaperSize "ANSI A (8.50 x 11.00 Inches)"
strPlotRot "Landscape"
strPlotStyle "Monochrome"
strFileName (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)))
) ;_setq
;; set PDF filename
(setq strFileName (strcat (vl-filename-directory a) ;; then build filename without extension
"\\"
(vl-filename-base a)
)
) ;_setq
;; Perform a detailed plot configuration
(command "_.PLOT" "Y")
;; Detail answers
(command "Model" ;;Enter a layout name
strOutDev ;;Enter an output device name
strPaperSize ;;Enter paper size
"I" ;;Enter paper units
strPlotRot ;;Enter drawing orientation
"N" ;;Plot upside down
"D" ;;Enter plot area, Display
"F" ;;Enter plot scale or[Fit]
"C" ;;Enter plot offset or [Center]
"Y" ;;Plot with plot styles
strPlotStyle ;;Plot style
"N" ;;Plot lineweights
"A" ;;Enter shade plot setting
(strcat strFileName ".PDF") ;;Write plot to file
"N" ;;Save change to page setup
"Y" ;;Proceed
) ;_command
When plotted with the LISP routine, certain fonts do not display well in Adobe products. In our, case it is Calibri and certain symbols such as the diameter symbol.
This apparently is a known issue:
When plotted with the PLOT dialog box, the fonts are included and appear correct when viewed in Adobe products.
When plotted with AutoLISP, the "capture" option seems to be ignored.
I hope to find a way to set the "capture" option when plotting with AutoLISP. Perhaps Visual LISP can access these settings.
Thank you for your time and attention. I look forward to your replies.
Regards,
Jerry
Solved! Go to Solution.
Solved by paullimapa. Go to Solution.
Your screen capture shows plot device as Dwg To Pdf.pc3
But your lisp code shows
strOutDev "AutoCAD PDF (Smallest File).pc3"
Have you tried changing your code to use the same?
Thanks for the quick reply.
I had been trying the different PDF output devices that I may have pasted the wrong code.
Can the capture option be set with code during plotting?
Regards,
Jerry
Also, I performed a detailed plot operation from the command prompt using 'DWG to PDF'. No prompt appeared asking about capturing fonts.
I’m not aware of an option to set that with code which is why it needs to be done first and then the matching pc3 used to plot
So when switching to a different printer, the user will have to manually set the option before they can plot with the LISP routine?
I am very curious how AutoCAD change the option through the interface, but not with code.
Yep all custom printer settings like page size, lines merge or overwrite and in your case fonts need to be already set in the pc3
Thanks, Paul.
I will try some tests next week.
Have a great weekend.
Regards,
Jerry
It's stored in Registry
HKEY_CURRENT_USER\SOFTWARE\Autodesk\AutoCAD\R23.1\ACAD-3000:409\Profiles\YourProfileName\Dialogs\AcQuickPublishOpts\CaptureFontsInDrawing
That registry entry is referring to the PUBLISH Options
But the OP is referring to the various printer/plotter *.pc3 device options located in the PLOT PDF Options window which are not related when running plot sequence using lisp:
You're right that it does not apply to the plot devices. Unfortunatelly.
Just to be accurate, there are actually two keys of the same name. Your screenshots referred to the other one. It's AcPublishDlg.
My AcQuickPublishOpts refers to this tool.
Got it. Thanks for the clarification.
I verified that the 'Capture" option was enabled in the PLOT dialog.
I plotted from the dialog and obtained a good PDF with readable dimensions using the Calibri font.
I then plotted from the command line and produced a similar PDF.
I closed AutoCAD and then searched the system registry for both "AcQuickPublishOpts" and "CaptureFontsInDrawing".
Neither of these could be found.
I am not sure how I was able to produce a good PDF using the command line if these registry settings are not available.
Reminder, there is no question about font capturing when doing a detailed plot from the command line.
Thoughts or suggestions to ensure fonts are captured when producing PDFs from the command line?
Regards,
Jerry
You were able to produce the good pdf because as I had replied in my previous post as long as your plot device pdf options is set to capture then you’ll succeed. Those other settings @ВeekeeCZ mentioned will only appear in the registry if you used at least once the ExportPDF command and made changes to the pdf options under that window. Again currently there’s no Autolisp method to set the pdf options within a printer device. This requires user input which is what you did as the first step before running your lisp. Now another possible workaround would be to use @ВeekeeCZ method to set the exportpdf pdf options and run the -Export command line version to generate a pdf. But you’ll lose the center option since export doesn’t have this option. A workaround for that would require you to setup everything exactly as you want in a layout then you would not require centering. Let me know if you want to try out that lisp option
Acknowledged. Thanks for clarifying.
We keep our PC3 files in a shared server folder, so as long as no user makes any changes, we should have this issue resolved.
I was hoping that I might be assured the font capture option was set each time before plotting, but seems to be difficult from an AutoLISP perspective.
We shall proceed and hope the PDF files will continue to capture fonts to ensure readable dimensions.
Thanks again, Paul.
Regards,
Jerry
glad to have helped...cheers!!!
In AutoLISP, you can control plot settings using the setenv function to set system variables. For PDF plotting, you might want to consider the PLOTCONFIG system variable. Here's an example of how you might use AutoLISP to set the 'capture' option for PDF plotting:
This example assumes that "PDF.pc3" is the plot configuration file you want to use, and "Capture" is the desired option for the 'capture' setting.
However, please note that the availability of specific options and system variables may vary depending on the AutoCAD version and the specific requirements of your project.
As for the additional keyword you provided, "Download Islamic PDF Books," please note that I can't assist with any requests or actions related to downloading copyrighted materials or any content that violates ethical or legal standards. If you have any non-infringing questions or need further clarification, feel free to ask.
Can't find what you're looking for? Ask the community or share your knowledge.