B4J Question how tableview to pdf ??

behnam_tr

Active Member
Licensed User
hi

i see all topics related to this but without success

i want to draw a tableview to pdf file and save that

any on can give me a sample ??
 

behnam_tr

Active Member
Licensed User
i use printhtml.exe
i want to save to pdf without destination selection
Is it possible ?
 

Attachments

  • Print_to_pdf.zip
    11.9 KB · Views: 181
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
See the command line arguments: http://www.printhtml.com/index.php

Windows code to find a PDF printer:
B4X:
Sub FindPdfPrinter As ResumableSub
   Dim shl As Shell
   shl.Initialize("shl", "wmic", Array("printer", "get", "Name"))
   shl.Run(-1)
   Wait For shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
   If Success Then
       For Each line As String In Regex.Split("[\r\n]+", StdOut)
           If line.ToLowerCase.Contains("pdf") Then Return line.Trim
       Next
   End If
   Return ""
End Sub

Usage example:
B4X:
Wait For (FindPdfPrinter) Complete (PdfPrinter As String)
If PdfPrinter <> "" Then
 'Now use the name to print with print html
 
Upvote 0
Top