API/CodeSamples/PdfPrintMode.md
... ...
@@ -0,0 +1,57 @@
1
+#PdfPrintMode
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+Gets or sets the value indicating what print mode will be used for printing PDF reports from the ReportDesigner and ReportViewer. EO.PDF is a .NET class library (DLL) that converts HTML to PDF. EO is lightweight, and all conversions occur inside the Izenda application, but it has some size limitations. PhantomJS is a headless webkit that is provided in all Izenda reference implementations in the bin/phantomjs folder. When PhantomJS PDF exports are requested, an EXE is triggered on the web server that produces the export and sends it to the client browser for download.
8
+
9
+**Default Value:** PdfMode.EOPDF
10
+
11
+Possible values:
12
+* EOPDF
13
+* PhantomJs
14
+
15
+[Print Modes](http://wiki.izenda.us/FAQ/understanding-izenda-print-modes)
16
+
17
+##Global.asax (C♯)
18
+
19
+``` csharp
20
+//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
21
+public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
22
+{
23
+ // Configure settings
24
+ // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
25
+ public static void InitializeReporting() {
26
+ //Check to see if we've already initialized.
27
+ if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
28
+ return;
29
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
30
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
31
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
32
+ AdHocSettings.PdfPrintMode = PdfMode.PhantomJs; //The relevant setting
33
+ HttpContext.Current.Session["ReportingInitialized"] = true;
34
+ }
35
+}
36
+```
37
+
38
+##Global.asax (VB.NET)
39
+
40
+```visualbasic
41
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
42
+Public Class CustomAdHocConfig
43
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
44
+
45
+ Shared Sub InitializeReporting()
46
+ 'Check to see if we've already initialized
47
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
48
+ Return
49
+ 'Initialize System
50
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
51
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
52
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
53
+ AdHocSettings.PdfPrintMode = PdfMode.PhantomJs 'The relevant setting
54
+ HttpContext.Current.Session("ReportingInitialized") = True
55
+ End Sub
56
+End Class
57
+```
... ...
\ No newline at end of file