I'm using COM interface for trying to convert a HTML file into a PDF file. My code is copied from the sample code provided with PDFCreator. Unfortunately when calling:
I´m trying to use the WebBrowser component (C# or VB), in my case C#, to navigate across the html temp file created in runtime and print to pdf from it. Obviously, setting AutoSaveDirectory property.
As for the problem with cClose causing PDFCreator to crash - I posted a solution in the forums a few weeks ago, but unfortunately it was lost in the forum update. I will see if I can figure out what I discovered was the cause and post it in Sourceforge.
What I do (from Java using Jacob) is to actuallt write all the autosave-settings to the registry before starting pdfcreator, and that works well enough, something like this:
ActiveXComponent wsh = new ActiveXComponent("WScript.Shell");
wsh.invoke("RegWrite", new Variant[]{ new Variant("HKEY_CURRENT_USER\\\\Software\\\\PDFCreator\\\\Program\\\\UseAutosave"), new Variant(1)});
wsh.invoke("RegWrite", new Variant[]{ new Variant("HKEY_CURRENT_USER\\\\Software\\\\PDFCreator\\\\Program\\\\UseAutosaveDirectory"), new Variant(1)});
wsh.invoke("RegWrite", new Variant[]{ new Variant("HKEY_CURRENT_USER\\\\Software\\\\PDFCreator\\\\Program\\\\AutosaveDirectory"), new Variant(baseDir)});
wsh.invoke("RegWrite", new Variant[]{ new Variant("HKEY_CURRENT_USER\\\\Software\\\\PDFCreator\\\\Program\\\\AutosaveFilename"), new Variant(outputFilename)});
wsh.invoke("RegWrite", new Variant[]{ new Variant("HKEY_CURRENT_USER\\\\Software\\\\PDFCreator\\\\Program\\\\AutosaveFormat"), new Variant(0)});
>I'm getting the same problem and I've tried the >.ShowOptionsDialog(False), but the dialog is displayed anyway.
Please describe exactly what you want. You can't disable the options dialog with this function. If you want disable the options you have to set a reg value.
The options have to be saved, or they won't take effect.
With pdfCreator If .cStart("/NoProcessingAtStartup") = False Then MsgBox "Can't initialize PDFCreator.", vbCritical + _ vbOKOnly, "Error!" Exit Sub End If .cClearLogfile .cClearCache .cOption("UseAutosave") = 1 .cOption("UseAutosaveDirectory") = 1 .cOption("AutosaveFormat") = 0 '0 = PDF .cSaveOptions .cOptions, "default" End With