B4J Question [SOLVED] Print pdf directly

micro

Well-Known Member
Licensed User
Longtime User
Hi to all
I use the jpdfjet library to create documents (layout with text, shapes, lines, images, etc.).
How can I directly print the pdf created on the default printer without opening any printer selection window etc.?
Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
Thank to all, now i try.
But there is a batch command in windows to run it with a shell for printer any files with default printer?
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
I do this each hour, every day, 365 days per year...
Next Reports generates a (shift) report (pdf) and puts it in a directory.
When completed the generation, I ask it to print a hard copy for the user.
If it did print, then I delete the report to clean up the directory...

Uses ABPDFBox supplied by ABMaterial

B4X:
Dim PDF As ABPDFBox ' ABM component - supplied to contributors

 If File.Exists(pdfFolder,fn&".pdf") Then
       ' fprinter is derived from an ini...  It defines the printer to direct output to - could be a network printer - as in my case
        If fprinter <> "" Then
            PDF.Print ( pdfFolder, fn&".pdf", fprinter, 1,  True)
            Sleep(1000)
            ' call DeletePdf(fn)  to remove the file (clean up)
        Else
'            Log("  _____----______ No Printer defined - stored for viewing later...")   
        End If
    Else
        Log(" File PDF not found: "&fn&".pdf")

    End If
 
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
Thanks to all
For now solved with ABPDFBox, it's work fine.
With JFX8Print lib get the name of the Default printer for use with ABPDFBox.Print
 
Upvote 0
Top