-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintFromWeb.aspx.vr
More file actions
53 lines (44 loc) · 1.8 KB
/
PrintFromWeb.aspx.vr
File metadata and controls
53 lines (44 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
BegClass PrintFromWeb Partial(*Yes) Access(*Public) Extends(System.Web.UI.Page)
//
// Print to PDF.
//
BegSr Button1_Click Access(*Private) Event(*This.Button1.Click)
DclSrParm sender Type(*Object)
DclSrParm e Type(System.EventArgs)
DclFld report Type(CustomerReport)
DclFld WebRoot Type(*String)
DclFld PDFFolder Type(*String)
DclFld PDFFileName Type(*String)
DclFld PrinterName Type(*String)
/*
| When printing to the MS native PDF driver, the printer name
| must be:
| "Microsoft Print to PDF"
| Use MS Word to save a sample document with this driver to ensure
| it is available. It should be present for Windows 10 or Windows
| Server 2016. It is not present, not is it available, for previous
| Windows or Windows Server versions.
*/
DclConst MS_PDF_DRIVER Value('Microsoft Print to PDF')
WebRoot = Server.MapPath('\')
// The PDFFolder is relative to the root.
PDFFolder = 'pdf-files'
PDFFileName = textboxPDFFileName.Text.Trim()
PrinterName = MS_PDF_DRIVER
report = *New CustomerReport(WebRoot, PDFFolder, PDFFileName, PrinterName)
report.Print()
Response.Redirect(report.VirtualPathToPDF)
EndSr
//
// Print to printer.
//
BegSr Button2_Click Access(*Private) Event(*This.Button2.Click)
DclSrParm sender Type(*Object)
DclSrParm e Type(System.EventArgs)
DclFld report Type(CustomerReport)
DclFld PrinterName Type(*String)
PrinterName = textboxPrinterName.Text.Trim()
report = *New CustomerReport(PrinterName)
report.Print()
EndSr
EndClass