Create PDF without PDF Printer

Navsyst2Navsyst2 Member Posts: 29
Hallo everybody,

could anyone tell me, if there anyway to create PDF Document without to install PDF-Printer?

Thanks

navsyst2

Comments

  • ta5ta5 Member Posts: 1,164
    You could use a DLL from www.activepdf.com
    The DLL contains all commands to create a pdf. A trial version is available there.
    Afaik there also exists freeware/opensource DLL's, but the one I know is for java only.

    Hope this helps
    Thomas
  • Navsyst2Navsyst2 Member Posts: 29
    Hi ha ha ha ha ha (ha5)

    thanks for your reply. I really appreciate it.

    Another question: Do you use activepdf in Navision too?

    Last guestion for everyone: Do anyone know how SAP works according to creating pdf-documents? They said that they didn't need to install any PDF-Printer. Is that true?

    Thanks..
  • ta5ta5 Member Posts: 1,164
    Hi
    I prefer ha*5 :lol:

    I used activepdf in a Web-Project with Active Server Pages, where it also was used as automation server. I do not use it in Navision.

    SAP: Sorry no info about this.

    Regards
    Thomas
  • gycsiakgycsiak Member Posts: 19
    Hi there!

    Anyone knows a way on Dynamics NAV 2009 SP1 (Build: 29626) in Classic Client, how to use Microsoft Print to PDF virtual printer in C/AL code to give the desired name and location for the result PDF, so that no standard file name request form jumps up, only the printing (I mean PDF generating) happens without any user interference?

    I tried to use this example, but it seems, that these .NET Framework Namespaces/DLLs are invisible in the Dev Environment, and on the same server, Dynamics 365 Business Central 14 Dev Env sees them and can declare them, as dotnet type Variables, but for 2009 SP1, they cannot be selected:

    Code example from web forums:

    PROPERTIES
    {
    OnRun=VAR
    FileName@1000000000 : Text[250];
    BEGIN
    FileName := 'c:\Temp\Demo.pdf';
    PrintDocument(FileName, '', 10000);
    END;

    }
    CODE
    {

    PROCEDURE PrintDocument@1000000001(FileName@1000000000 : Text[250];PrinterName@1000000003 : Text[250];TimeoutInMs@1000000004 : Integer);
    VAR
    Process@1000000002 : Automation "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.Process" RUNONCLIENT;
    StartInfo@1000000001 : Automation "'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.ProcessStartInfo" RUNONCLIENT;
    PrinterSettings@1000000005 : Automation "'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.Drawing.Printing.PrinterSettings" RUNONCLIENT;
    BEGIN
    IF PrinterName = '' THEN BEGIN
    // Falls kein Drucker angegeben, den Standarddrucker verwenden
    PrinterSettings := PrinterSettings.PrinterSettings;
    PrinterName := PrinterSettings.PrinterName;
    END;

    StartInfo := StartInfo.ProcessStartInfo;
    StartInfo.Verb := 'PrintTo';
    StartInfo.FileName := FileName;
    StartInfo.Arguments := '"' + PrinterName + '"';

    Process := Process.Process;
    Process.StartInfo := StartInfo;

    Process.Start;
    IF NOT Process.WaitForExit(TimeoutInMs) THEN BEGIN
    Process.Kill;
    END;
    END;

    BEGIN
    END.
    }

    Thanks in advance,

    Best begards,
    Gyula
  • vaprogvaprog Member Posts: 1,140
    Your code, if it runs, prints the file given by the FileName parameter to the printer given by the PrinterName parameter, using the default app that is registered for printing files with the filename extension given by the FileName parameter.

    If you want to specify the filename that the printer should generate, you would need to create a printer port, or search for, install and then control a printer port that lets you specify the output filename the port writes to.

    I don't know if such software is available. I know it used to be possible to specify a file name as printer port. (Entries like LPT1: or COM1: are essentially just that: a device accessible via the API for writing files.)
  • vaprogvaprog Member Posts: 1,140
    REPORT.SAVEASPDF is not a thing in NAV 2009 SP1.
  • gycsiakgycsiak Member Posts: 19
    edited 2023-03-09
    nexpayne wrote: »

    Hi,

    The reports are in a classical format and object, and no resource is allocated to convert all of them to RDLC-Type reports and use RTC Client instead, so this option is not available in our situation.

    Meanwhile, I have found a possible solution to our demand, which can be set up for Auto-Save Folder and Filename Template also for future PDF-Printing:

    https://github.com/clawsoftware/clawPDF
Sign In or Register to comment.