COM request

Would it be possible to create a way to change the PDFCreator settings without having to print something first?  All of the examples create the windows test page and then call PDFCreatorQueue.NextJob to adjust the settings. It would be nice if one could modify the settings before having to print something.  How about about a “NewJob” call as well as NextJob?


var job = PDFCreatorQueue.NextJob;
job.SetProfileByGuid(“DefaultGuid”);

Thank you for all your hard work on this great product.

Hello,

what could be a reason to do this? I mean, by applying settings, you want to tell PDFCreator how a specific print job should be printed, if there is none, why do you want to tell it, how to print one. Further, why does it make a difference to you, if you set the settings for a job before arriving or after arriving?

Maybe I’m not getting your intention, in that case it would be nice, if you would post use cases or detailed examples.

Regards,

Sazan


Hi Sazan, 


Thank you for addressing my request.  A better example would be printing multiple documents to different directories using the .PrintFile procedure and the autosave functionality.

// Declare the PDFCreator object
pdfforge.PDFCreator.COM.PdfCreatorObj pdfCreator As New pdfforge.PDFCreator.COM.PdfCreatorObj();

// I can’t set the auto-save directory here
// Print the first file
pdfCreator.PrintFile(myFile1);

// I can’t set the auto-save directory here either
// Print the second file
pdfCreator.PrintFile(myFile2);


Hopefully this pseudo-code does a better job of explaining what I’m looking for.  Please let me know if you have any ideas about how to approach this issue or need more information.

Thanks again!





Hey,

one thing first: the workflow of the new COM Interface has completely changed in comparison to the old, there is no autosave property anymore for good reasons. Please read the manaul especially the COM Interface part of it carefully.

To achieve your above goal, you would do something like the following:

//assuming that you want to print  3 files
pdfCreator.PrintFile(myFile1);
pdfCreator.PrintFile(myFile2);

pdfCreator.PrintFile(myFile3);

if (jobQueue.WaitForJobs(3,20)) {
//3 jobs didn’t arrive within 20 seconds
//do something, maybe throw exception…
}else{
//All jobs are now in your job queue
var printJob1 = jobQueue.GetNextJobByIndex(0);
var printJob2 = jobQueue.GetNextJobByIndex(1);
var printJob3 = jobQueue.GetNextJobByIndex(2);

//Now for each job set the specific settings
printJob1.SetProfileByGuid(“DefaultGuid”);
printJob1.SetProfileSetting(“SomeSetting”,“SomeValue”);
//The same thing you would do for printJob2 and printJob3 to prepare them for conversion
printJob1.ConvertTo(“C:\mydir\testDir\myfile1.pdf”);
printJob2.ConvertTo(“C:\mydir\someOtherTestDir\myfile2.pdf”);
printJob3.ConvertTo(“C:\mydir\againAnotherTestDir\myfile2.pdf”);

//And some post processing after conversion finished
}

Please have a look at the manual and the javascript examples provided so far. The code above closely corresponds to the examples provided in the pdfcreator COMScripts directory.

You’re welcome :slight_smile:

Where is the “pdfforge.PDFCreator.COM” dll located? So I can reference it my project.

Hi,


you can reference the PDFCreator.exe directly.

best regards,