Navision & PDF Files

Hi all. I have a report that saves in HTML format but the problem is the saved document doesnt show graphics orather images. I though of saving it as PDF so how do i do this programmatically using codes like i used to save in HTML.

These are sample codes that i had writen to save as HTML, so hw do i write codes for saving as PDF

REPORT.SAVEASHTML()

Thanx

This is a link to a how to save as pdf on mibuso. http://www.mibuso.com/forum/viewtopic.php?t=18331&highlight=

Try to search pdfcreator in mibuso.com. Mibuso has more discussion on this topic.

Hi Guys one again. So far so good. but help me finish completly on this issue. I managed to download the pdf creator and install it. Now on the report to be ssved as pdf i wrote the following codes.

IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);
IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);

ReportID := REPORT::“Send Member Invoice Emails”;
IF Object.GET(Object.Type::Report,’’,ReportID) THEN;
FileDirectory := ‘C:’;
FileName2 := ‘INVOICES.PDF’;
PDFCreatorError := PDFCreator.cError;

IF PDFCreator.cStart(’/NoProcessingAtStartup’,TRUE) = FALSE THEN
ERROR(‘Status: Error[’ + FORMAT(PDFCreatorError.Number) + ']: ’ + PDFCreatorError.Description);

SalesHeader := “Sales Invoice Header”;
SalesHeader.SETRECFILTER;
IF Cust.GET (SalesHeader.“Sell-to Customer No.”) THEN BEGIN
IF Cust.“E-Mail” <> ‘’ THEN BEGIN
EmailAdd := Cust.“E-Mail”;
Window.OPEN(‘processing’);
WindowisOpen := TRUE;
IF FileName2 = ‘’ THEN
ERROR(‘Please specify what the file should be saved as’);

Object.GET(Object.Type::Report,’’,ReportID);
PDFCreatorOption := PDFCreator.cOptions;

//TEST PASSWORD
PDFCreatorOption.PDFUseSecurity :=1;
PDFCreatorOption.PDFOwnerPass := 1;
PDFCreatorOption.PDFOwnerPasswordString := ‘MasterPass’;

PDFCreatorOption.PDFDisallowCopy := 1;
PDFCreatorOption.PDFDisallowModifyContents := 1;
PDFCreatorOption.PDFDisallowPrinting := 1;

PDFCreatorOption.PDFUserPass := 1;
PDFCreatorOption.PDFUserPasswordString := ‘UserPass’;

PDFCreatorOption.PDFHighEncryption := 1;
//TEST PASSWORD

PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveDirectory := FileDirectory;
PDFCreatorOption.AutosaveFormat := 0; //PDF file, you can also save in other formats
PDFCreatorOption.AutosaveFilename := FileName2;

PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := ‘PDFCreator’;
PDFCreator.cPrinterStop := FALSE;

REPORT.RUNMODAL(ReportID,FALSE,TRUE);

END;

END;

Now when i run the report am getting this error " Recursive function calls" Any bosy with any idea how to solve this?

Can you run th edebugger, and see where it is bombing out?

Thanx. I run the debugger and got it. Now tell me i want the whole process to save the pdf file on a prespecified folder and then sent the file to a preset email address AUTOMATICALLY. What is happening at the moment is the PDF Creator is bringing a dialog box prombting me to save or sent as email.

Could it be am using the wrong version of pdf creator? This the one am using

"PDFCreator-0_9_3_GPLGhostscript.exe"

Please assist me. Thanx in advance.

Why are you running all this code, when you could just set all this in options for autosave?

After that you would merely have to pick up the file from the location (which you have to save in NAV) using NAV internal mail or system default mail… using standard NAV objects.

ok thanx for your comments but can you please give me diraction to the outo save. Where do i set it? and how?

Thanks

Unfortunately that really does not work in the real world. The idea of using the automation, is that there is no user intervention required. Using Autosave mean having to set up each computers PDFCreator, and also setting up procedures for this all to happen. I have a client that sends out about 1.200 invoices a day, and this needs to be fully automated. You can’t rish it getting messed up like that.

In the case of a client that sends say 10 invoices a day, then yes the Auto save option is fine.

Ok guys am confused. Infact am done with the saving of the file as pdf and sending it to my customer. BUT the annoying thing is that the document is password protected.

My QS is what version of pdf creator do i need to use. plz you can sent me one.

thankx

But why everybody has to have it’s own pdfcreator? The concept of a printserver / server / shared printer seems to have been forgotten in your case…

Additionally you could just set up a printer route in NAV for a specific report…

I have built several working systems like that and I just love the pdfcreator soft.