Something Else I would try also is open PdfCreator Printer. Click on File->Option and resetall button
If things go horribly awry, and you lose the ability to choose options when printing to PDFCreator, just go to the above, click on Printer\Settings, and click the big "Reset all Settings" button (shown below). That will restore you to the defaults, and you'll be good to start playing around again
yes this is very strange indeed. I've tried to reset all settings, and no luck, then i even installed the latest version of pdfcreator and nothing... I really don't know what's the problem, but the thing is that the other options like autosave doesn't work right either.
The 0.9.6 version of PdfCreator seems to solve the cClose function hanging behaviour. I installed this version today and it seems to be working faster, properly closing and the eReady event fires correctly.
i am using bullzip now.
on an xp machine it is working great now.
on a vista machine the code is run but there is no file.
What can it be?
the code i use is this:
Best regards,
Rod.
[-o<
recSalesHeader.SETRANGE("Document Type", Rec."Document Type");
recSalesHeader.SETRANGE("No.", Rec."No.");
and thanks to all for this post! You all helped me a lot in my work (ara3n you're the best =D> )
After a lot of try, i successfully used pdfCreator 0.9.6 on Vista :x
the worst problem? you can't save your pdf in "c:\" !!!
if you try, pdf creator seems to work in background but the file is simply not created, without warnings or message.
I've just tried to change the directory in "d:\" and it works perfectly...
I hope i can help someone to save a lot of time testing!
I am using Rashed's code to print e.g. Invoices, and modify the code further to send these invoices as email to customers.
The problem I have is at saving the files to PDF. Apparently, the results of the pdf save is not consistent. Sometimes, all the invoices are saved as PDF, sometimes not all the invoices are saved as PDF. I found out that when the batch job is run, and if NAV loses focus (e.g. If you miminise nav, and do other things while the batch job is running) then not all the pdf files will be saved.
Initially, in my development, I added progress bars to update the status of the pdf save operation, but I found out that if dialog boxes are implemented, somehow, PDFcreator also loses focus, and it sometimes run into errors.
Is anybody having similar problems as what I am facing? I am beginning to think that using PDFcreator is not such a good solution after all, and looking into other alternatives.
I have also experienced misc problems using PDFCreator. I used it in an WebPortal for printing Invoices and Cr.Memos, then hyperlink the saved PDF document.
(Sometimes or often there were no pdf created at all...)
I thought maybe the problem was print queues, so I also implemented Rashed Bullzip solution so that the NAS is alternating using the 2 diff
printers. The solutions is now somewhat more stable.
I would recomend you to use the Bullzip solution, thanks to Rashed for this one =D>
I have found the reason for the erratic behaviour with PDFcreator. In PDFCreator if we use the following statement:
REPEAT
SLEEP(1000);
WaitTime += 1000;
IF WaitTime = 15000 THEN
ERROR('Timeout error while waiting for PDFCreator.cIsConverted!');
UNTIL PDFCreator.cIsConverted;
to check for completion of PDFcreation, you have to initialise PDFCreator.cIsConverted := FALSE. Else, somehow, the property PDFCreator.cIsConverted will always retain the values from the last run. Even if you have executed CLEAR(PDFcreator). I have run several tests with 100++ pdf creations, and the results seem to be consistent now.
This is what I added to make Bullzip default printer.
IF NOT lPrinterSelection.GET('',lReportID) THEN BEGIN
lPrinterSelection.INIT;
lPrinterSelection."Report ID" := lReportID;
lPrinterSelection."Printer Name" := 'Bullzip PDF Printer';
lPrinterSelection.INSERT;
END;
Works great!
Thanx again.
Maarten
Here is the code.
Ahmed Rashed Amini
Independent Consultant/Developer
How can I Close the PDFCreator Process because I used PDFCreato.cClose() and only close the PDF Monitor and when it happens and if I run again the code can't creat the file. Here's my code: thanks
Window.OPEN('En proceso ...');
WindowIsOpen := TRUE;
IF _ArchivoPDF = '' THEN
ERROR('De un nombre al archivo');
IF Objeto.GET(Objeto.Tipo::Report,'',_ReportID) THEN
BEGIN
IF ObjetoTabla.GET(ObjetoTabla.Tipo::Table,'',_TablaID) THEN
BEGIN
IF FORMAT(ObjetoTabla.Nombre)='Cab. compra' THEN
BEGIN
Cabcompra.RESET;
Cabcompra.SETFILTER(Cabcompra."Nº",No);
Cabcompra.SETFILTER(Cabcompra."Tipo documento",'Pedido');
IF Cabcompra.FIND('-') THEN
REPORT.RUNMODAL(_ReportID,FALSE,TRUE,Cabcompra);
END;
END;
Comments
.
http://www.excelguru.ca/node/33
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Regards
you can also try Bullzip.
http://mibuso.com/blogs/ara3n/2008/08/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
There is a REPORT.SAVEASPDF(ReportID...) function !!! \:D/
(also contains SAVEASEXCEL and SAVEASXML)... Haven't tried them yet thou.
and on RTC client.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
i am using bullzip now.
on an xp machine it is working great now.
on a vista machine the code is run but there is no file.
What can it be?
the code i use is this:
Best regards,
Rod.
[-o<
recSalesHeader.SETRANGE("Document Type", Rec."Document Type");
recSalesHeader.SETRANGE("No.", Rec."No.");
IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF);
ReportID := REPORT::"Order Confirmation";
FileDirectory := 'C:\';
FileName :='test.pdf';
Object.GET(Object.Type::Report,'',ReportID);
BullZipPDF.Init;
BullZipPDF.LoadSettings;
RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
BullZipPDF.SetValue('Output',FileDirectory+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.WriteSettings(TRUE);
REPORT.RUNMODAL(ReportID,FALSE,FALSE,recSalesHeader);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN
SLEEP(1000);
TimeOut := TimeOut + 1;
END;
and thanks to all for this post! You all helped me a lot in my work (ara3n you're the best =D> )
After a lot of try, i successfully used pdfCreator 0.9.6 on Vista :x
the worst problem? you can't save your pdf in "c:\" !!!
if you try, pdf creator seems to work in background but the file is simply not created, without warnings or message.
I've just tried to change the directory in "d:\" and it works perfectly...
I hope i can help someone to save a lot of time testing!
Here is my Code
I am using Rashed's code to print e.g. Invoices, and modify the code further to send these invoices as email to customers.
The problem I have is at saving the files to PDF. Apparently, the results of the pdf save is not consistent. Sometimes, all the invoices are saved as PDF, sometimes not all the invoices are saved as PDF. I found out that when the batch job is run, and if NAV loses focus (e.g. If you miminise nav, and do other things while the batch job is running) then not all the pdf files will be saved.
Initially, in my development, I added progress bars to update the status of the pdf save operation, but I found out that if dialog boxes are implemented, somehow, PDFcreator also loses focus, and it sometimes run into errors.
Is anybody having similar problems as what I am facing? I am beginning to think that using PDFcreator is not such a good solution after all, and looking into other alternatives.
http://mibuso.com/blogs/ara3n/2008/08/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
(Sometimes or often there were no pdf created at all...)
I thought maybe the problem was print queues, so I also implemented Rashed Bullzip solution so that the NAS is alternating using the 2 diff
printers. The solutions is now somewhat more stable.
I would recomend you to use the Bullzip solution, thanks to Rashed for this one =D>
Best regards
ObiWan
I have found the reason for the erratic behaviour with PDFcreator. In PDFCreator if we use the following statement:
REPEAT
SLEEP(1000);
WaitTime += 1000;
IF WaitTime = 15000 THEN
ERROR('Timeout error while waiting for PDFCreator.cIsConverted!');
UNTIL PDFCreator.cIsConverted;
to check for completion of PDFcreation, you have to initialise PDFCreator.cIsConverted := FALSE. Else, somehow, the property PDFCreator.cIsConverted will always retain the values from the last run. Even if you have executed CLEAR(PDFcreator). I have run several tests with 100++ pdf creations, and the results seem to be consistent now.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Here is the code.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Window.OPEN('En proceso ...');
WindowIsOpen := TRUE;
IF _ArchivoPDF = '' THEN
ERROR('De un nombre al archivo');
IF Objeto.GET(Objeto.Tipo::Report,'',_ReportID) THEN
BEGIN
CLEAR(PDFCreator);
CREATE(PDFCreator);
PDFCreator.cStart();
//***
CLEAR(PDFCreatorOptions);
CREATE(PDFCreatorOptions);
//***
CLEAR(PDFCreatorError);
CREATE(PDFCreatorError);
IF EXISTS(_Directorio + _ArchivoPDF + '.pdf') THEN
BEGIN
ERASE(_Directorio + _ArchivoPDF + '.pdf');
END;
PDFCreatorOptions := PDFCreator.cOptions;
ReadyState := 0;
//Defaultprinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreatorOptions.UseAutosave := 1;
PDFCreatorOptions.UseAutosaveDirectory := 1;
PDFCreatorOptions.AutosaveFormat := 0; //Formato PDF
PDFCreatorOptions.AutosaveDirectory := _Directorio;
PDFCreatorOptions.AutosaveFilename := _ArchivoPDF;
//PDFCreator.cOptions:=PDFCreatorOptions;
PDFCreator.cSaveOptions(PDFCreatorOptions);
PDFCreator.cClearCache();
PDFCreator.cPrinterStop := FALSE;
Filename := _Directorio + _ArchivoPDF + '.pdf';
PDFCreatorError := PDFCreator.cError;
IF ObjetoTabla.GET(ObjetoTabla.Tipo::Table,'',_TablaID) THEN
BEGIN
IF FORMAT(ObjetoTabla.Nombre)='Cab. compra' THEN
BEGIN
Cabcompra.RESET;
Cabcompra.SETFILTER(Cabcompra."Nº",No);
Cabcompra.SETFILTER(Cabcompra."Tipo documento",'Pedido');
IF Cabcompra.FIND('-') THEN
REPORT.RUNMODAL(_ReportID,FALSE,TRUE,Cabcompra);
END;
END;
PDFCreator.cClearCache();
PDFCreatorOptions.SaveFilename(Filename);
//PDFCreator.cOptions :=PDFCreatorOptions;
PDFCreator.cClose();
SLEEP(200);
//CLEAR(PDFCreatorOptions);
CLEAR(PDFCreator);
Window.CLOSE;
END;
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I have downloaded PDFCreator v 0.9.7 and copied Object Form 50100 Example Report to PDF Files.
But encountered an error while compiling "Could not load the selected type Library."
I am testing the PDF capabilities at the moment.
Could you help?
I have solved the problem by replacing automation at the C/AL Global
Thanks
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
If i want to create a pdf and after i want to print the same, do you know as to do it.
I'm trying to do this, but it create a pdf but doesn't print.
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);
IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveDirectory := Route;
PDFCreatorOption.AutosaveFormat := 0; PDFCreatorOption.AutosaveFilename := FileName;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
//Here i create a pdf
REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesInvHeader);
//And here i want to print
CLEAR(PDFCreator);
CLEAR(PDFCreatorError);
REPORT.RUN(ReportSelection."Report ID",FALSE,FALSE,SalesInvHeader);
Do you know what is the problem??
Thanks
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav