Hello everyone.
I must switch from existing code written for BullZip to PDF Creator but I am really not sure how.
This is my code for BullZip with some general variables:
IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF,TRUE,TRUE);
FileDirectory := TableSetup."Path To Save PDF";
FileName := STRSUBSTNO(Text001,Table1.Month,Year) + '.pdf';
Text001 := FileName;
FileName := FileDirectory+FileName;
RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
BullZipPDF.Init;
BullZipPDF.LoadSettings;
BullZipPDF.SetValue('Output',FileName);
BullZipPDF.SetValue('Showsettings', 'never');
BullZipPDF.SetValue('ShowPDF', 'no');
BullZipPDF.SetValue('ShowProgress', 'no');
BullZipPDF.SetValue('ShowProgressFinished', 'no');
BullZipPDF.SetValue('SuppressErrors', 'yes');
BullZipPDF.SetValue('ConfirmOverwrite', 'no');
BullZipPDF.SetValue('OwnerPassword','123');
IF NOT Setup."Create Password" THEN BEGIN
VALIDATE("Pasword for PDF",Table2."PDF Password");
MODIFY;
END;
BullZipPDF.SetValue('userpassword','ENCRYPTED');
BullZipPDF.SetValue('userpassword',"Password for PDF");
BullZipPDF.SetValue('keylength','128');
BullZipPDF.WriteSettings(TRUE);
SLEEP(700);
Table3.SETRANGE("Filter code","Code");
Table3.SETRANGE("Filter no.","No.");
REPORT.RUNMODAL(REPORT::"PDF report",FALSE,FALSE,Table3);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 15) DO BEGIN
SLEEP(1000);
TimeOut := TimeOut + 1;
END;
VariableChar := 13;
I have no clue how to switch from this to PDF Creator since I don't know which functions are same since names are different.
I tried something like this but I don't think it's ok and I still don't know which PDF Creator function is same as BullZipPDF.SetValue
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator,true,true);
IF ISCLEARPDFCreatorError) THEN
CREATE(PDFCreatorError,true,true);
FileDirectory := TableSetup."Path To Save PDF";
FileName := STRSUBSTNO(Table.Month,Year) + '.pdf';
Text001 := FileName;
FileName := FileDirectory+FileName;
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.AutosaveDirectory := FileDirectory;
PDFCreatorOption.AutosaveFilename := FileName;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveFormat := 0;
PDFCreator.cOptions := gaPDFCreatorOption;
PDFCreator.cClearCache();
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
REPORT.RUNMODAL(50084,FALSE,TRUE,Item);
SLEEP(600);
Table3.SETRANGE("Code","Code");
Table3.SETRANGE("No.","No.");
REPORT.RUNMODAL(REPORT::"PDF report",FALSE,FALSE,Table3);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 15) DO BEGIN
SLEEP(1000);
TimeOut := TimeOut + 1;
END;
locChar := 13;
I must switch from existing code written for BullZip to PDF Creator but I am really not sure how.
This is my code for BullZip with some general variables:
IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF,TRUE,TRUE);
FileDirectory := TableSetup."Path To Save PDF";
FileName := STRSUBSTNO(Text001,Table1.Month,Year) + '.pdf';
Text001 := FileName;
FileName := FileDirectory+FileName;
RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
BullZipPDF.Init;
BullZipPDF.LoadSettings;
BullZipPDF.SetValue('Output',FileName);
BullZipPDF.SetValue('Showsettings', 'never');
BullZipPDF.SetValue('ShowPDF', 'no');
BullZipPDF.SetValue('ShowProgress', 'no');
BullZipPDF.SetValue('ShowProgressFinished', 'no');
BullZipPDF.SetValue('SuppressErrors', 'yes');
BullZipPDF.SetValue('ConfirmOverwrite', 'no');
BullZipPDF.SetValue('OwnerPassword','123');
IF NOT Setup."Create Password" THEN BEGIN
VALIDATE("Pasword for PDF",Table2."PDF Password");
MODIFY;
END;
BullZipPDF.SetValue('userpassword','ENCRYPTED');
BullZipPDF.SetValue('userpassword',"Password for PDF");
BullZipPDF.SetValue('keylength','128');
BullZipPDF.WriteSettings(TRUE);
SLEEP(700);
Table3.SETRANGE("Filter code","Code");
Table3.SETRANGE("Filter no.","No.");
REPORT.RUNMODAL(REPORT::"PDF report",FALSE,FALSE,Table3);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 15) DO BEGIN
SLEEP(1000);
TimeOut := TimeOut + 1;
END;
VariableChar := 13;
I have no clue how to switch from this to PDF Creator since I don't know which functions are same since names are different.
I tried something like this but I don't think it's ok and I still don't know which PDF Creator function is same as BullZipPDF.SetValue
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator,true,true);
IF ISCLEARPDFCreatorError) THEN
CREATE(PDFCreatorError,true,true);
FileDirectory := TableSetup."Path To Save PDF";
FileName := STRSUBSTNO(Table.Month,Year) + '.pdf';
Text001 := FileName;
FileName := FileDirectory+FileName;
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.AutosaveDirectory := FileDirectory;
PDFCreatorOption.AutosaveFilename := FileName;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveFormat := 0;
PDFCreator.cOptions := gaPDFCreatorOption;
PDFCreator.cClearCache();
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
REPORT.RUNMODAL(50084,FALSE,TRUE,Item);
SLEEP(600);
Table3.SETRANGE("Code","Code");
Table3.SETRANGE("No.","No.");
REPORT.RUNMODAL(REPORT::"PDF report",FALSE,FALSE,Table3);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 15) DO BEGIN
SLEEP(1000);
TimeOut := TimeOut + 1;
END;
locChar := 13;