Saving PDF with COM from PDFCreator

9 posts in this topic


Sorry to ask this, I'm sure this is a pretty low level question, but can't figure it out by my own.

I found plenty of threads, and I know that there is UDFs for this (my request to download Scite Config to try and implement it was denied...)

I'm automating a program, to test it. I have basicly everything set by now (thanks to not small part to this forum) or what I miss I already know how to handle.

My only remaining thing I want to achive is to communicate with PDFCreator with COM, not using its UI.

In a specific part of the automatization the PDFCreator pops up (it saves/print the bills if neceserry) what I would like to achive is to tell the PDFCreator to rename and save the document to a folder. I know this should be done with Obj functions, but I don't know where can I find the "commands".

I have read ptrex PDFCreatur UDF, but still I just don't get it. Right now I think I need to "create" an ObjCreate to the poping up window as a variable, and then communicate what I want it to do with it somehow. I don't know the commands, and not even sure what to use other then ObjCreate.

Thank you for your help!

Share this post

Link to post
Share on other sites

Did you try the automatic saving in PDFCreator ? You can configure a PDFCreator printer (profile) witch generates PDF in silent mode in the specified folder, with a specified file name. Also, you can configure it to execute a script after the PDF conversion.



1 person likes this

Share this post

Link to post
Share on other sites

That could work, at least I thought about that, but the problem is that the software should be able to run on different computers. Do you suggest, that I should try to set the automatic saving every time someone starts the program? I don't see anyother way since someone could be using this on his computer for something else.

Then I should reset it to his original settings once he exit my program. The idea itself would be good, but I may just miss on how it should be implemented.

Share this post

Link to post
Share on other sites

I don't get the edit function yet so I just post again, I meant by "someone could be using this on his computer for something else." that someone may have set up the automatic PDFsave for something else.

But even If I ignore it, how can I realiable make my program, to set the autosave of PDF to somewhere when a new update can completly change the UI.

Share this post

Link to post
Share on other sites

Thank you, but I have found that (have it open right now :) )

I understand the with endwith loop thanks to the help file, but where I'm lost is from where Master Pretex knew the commands? .c0ption? I'm not sure whats happening inside here, but I try to explain what I see:

He sets autosave on (i guess) and tell it to use autosave directory, then set that directory to, I don't know that part, $fso = ObjectCreate("scripting.filysystemobject"), or the.GetParentFoldername part, I get the AutosaveFilename, and the format, but not much after that. 

Also In the help file, I assumed that these "commands" would be like .UseAutosave , thats just confuse me a bit more

.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = $fso.GetParentFolderName(@ScriptFullPath)
.cOption("AutosaveFilename") = "Testpage - PDFCreator"
.cOption("AutosaveFormat") = 0 ; 0=PDF, 1=PNG, 2=JPG, 3=BMP, 4=PCX, 5=TIFF, 6=PS, 7= EPS, 8=ASCII
$DefaultPrinter = .cDefaultprinter
.cDefaultprinter = "PDFCreator"
.cPrinterStop = 0

Share this post

Link to post
Share on other sites

#7 ·  Posted (edited)


.cOption("AutosaveDirectory") = 'C:\your path\'


EDIT: Download PDFCreator 1.7.3 and open its Helpfile, there is section COM where these options & functions are described. There are also examples in

"C:\Program Files (x86)\PDFCreator\COM\VB6\"

Edited by Zedna

Share this post

Link to post
Share on other sites

Hmm, can I easly compile togeather my script with a 1.7.3 PDC creator somehow? (muprhy that it was the one i started with, i liked it pretty much even if i hadn't worked to much with it)

Share this post

Link to post
Share on other sites


Check here:


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Iznogoud
      By Iznogoud
      I am trying to find more information on generating PDF files from AutoIT and found the UDF topic 
      Also found some info on creating .FDF file and use PDFTK for merging, but i can't find info about a custom based layout.
      What i trying to find out is, if it is possible to generate a variable layout. For an example i created a script which is based out 20 fields and every field can contain information. If one of those fields are not filled, it shouldn't be printed on the PDF either.
      To make it more difficult, the PDF should contain a heading, the first 10 fields and then a horizontal line across the PDF and then a new heading and then show the last 10 fields.
      But only the fields which are filled.
      Is this possible?
    • Gowrisankar
      By Gowrisankar
      Hello everyone,
      I'm working on a task where, a PDF file is opened (in IE browser) when I click a link in a website.
      I have to read the first page of the PDF to find particular strings. Can you please share some ideas?
    • mLipok
      By mLipok
      I found a code in C++ for file format conversion from RTF to PDF with using Debenu QuickPDF.
      I know how to use Debenu QuickPDF in AutoIt .
      My question is about RTF part of this code:
      HDC hdcNew = debenu->GetCanvasDC( RTFPRINTINGDOTSPERINCH * RTFPAGEWIDTHININCHES, RTFPRINTINGDOTSPERINCH * RTFPAGEHEIGHTININCHES); canvas = new TCanvas; canvas->Handle = hdcNew; RVReportHelper1->DrawPage( PageCounter, canvas, true, RTFPRINTINGDOTSPERINCH * RTFPAGEHEIGHTININCHES); // LastPageHeight);  
      First there is hdcNew declaration , and this is not the problem.
      My problem is in converting the following code snippet, to AutoIt
      canvas = new TCanvas; canvas->Handle = hdcNew; RVReportHelper1->DrawPage( PageCounter, canvas, true, RTFPRINTINGDOTSPERINCH * RTFPAGEHEIGHTININCHES); // LastPageHeight);
      If you remember, I created RTFPrinter sometime ago. But it was some time ago , and created by trial and error, rather than in-depth analysis.
      Also, it was just a modification of another script, not my own work from scratch.
      So now I'm looking for help how to adapt this code snippet to AutoIt.
      Any tips ?
    • Kiran_L
      By Kiran_L
      Hi guys,
      I am trying to read a pdf file with unstructured data. I dontot know how to handle pdf activities in AutoIt,
      Can you help me with any UDF to open the PDF and read the doc.
      Thanks for your time.
    • Mag91
      By Mag91
      Hey Community,
      cause im too new in the Auto it world i will try it with the your help. hopefully.
      I woud like to know how i can handle my Problem.
      I have a Excel Data with 362 random numbers.
      For Example:
      1166642335374 1172899897343
      this numbers are a part of the filepath ...example
      as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
      This is my first question. How can i handle this to make it Shell execute.
      Second question:
      If i am in the path.
      For Example:
      the code shoud search for specific PDF Files.
      They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
      the first 15 letters are always the same
      when he found this data he has to copy it on a Folder on the Desktop.
      (There can also be 2 or 3 pdfs in one Folder with this letters)
      Please give me some help :-)