File in use problem on MERGE

About the programming interface for the virtual PDF printer driver.

Moderator: jr

File in use problem on MERGE

Postby rewind » Mon Aug 25, 2008 4:42 pm

Hello.

Ive been using bullzip to merge documents for a while. However when I combine large files after each other I get a file in use warning up. When poking in filemon/processmon it's caused by a File share violation from Gui.exe because more than gui/gs process has spawned at a time even when waiting for the runonce to be disappear before starting the next merge. Using 3.0.0.323 - is this a known problem with this version or Is it "per design" that the runonce ini file is removed once the printer job has left the queue instead of when the gui/gs processes has finished creating the file and returned?

pseudo code - ObjectPal (yes I know it ancient but required for this job ;)
-----------------------

method MergePDFToPDF(pdfname string, mergename string)
//set bullzip conf file path
settingstr = readEnvironmentString("APPDATA")
settingstr = settingstr + "\\Bullzip\\PDF Printer\\runonce.ini"
//create merge options
writeProfileString(settingstr, "PDF Printer", "ConfirmOverwrite", "no")
writeProfileString(settingstr, "PDF Printer", "ShowSaveAS", "never")
writeProfileString(settingstr, "PDF Printer", "ShowSettings", "never")
writeProfileString(settingstr, "PDF Printer", "MergeFile", mergename)
writeProfileString(settingstr, "PDF Printer", "Output", mergename)
writeProfileString(settingstr, "PDF Printer", "ShowPDF", "never")
writeProfileString(settingstr, "PDF Printer", "GhostscriptTimeout", "600")

//merge pdf using foxit and bullzip
printpdfFileFoxit(pdfname, "Bullzip PDF Printer")
sleep(200)

//wait until conf file is removed (printing done)
while isFile(settingstr)
sleep(200)
endwhile
endMethod

method PrintPdfFileFoxit(filename string, printername string)
if isfile(filename) then
if printername = "" then
//print document using current printer
execute("C:\\foxit\\foxit.exe /p " + "\"" + filename + "\"")
else
//print document using specified printer
execute("C:\\foxit\\foxit.exe/t " + "\"" + filename + "\" \"" + printername + "\"")
endif
endif
endMethod

mvh
Jon
rewind
 
Posts: 2
Joined: Mon Oct 01, 2007 4:33 pm

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest