@@ -17,9 +17,12 @@ To convert HTML to PDF, send a request to the /v1/conversion/html-to-pdf endpoin
1717
1818{% highlight c# tabtitle="Curl" %}
1919
20+ For URL
21+
2022curl --location 'http://localhost:8003/v1/conversion/html-to-pdf ' \
2123 --form-string 'settings={
2224 "JobID": "job-123",
25+ "IndexFile":"",
2326 "PaperSize": "A4",
2427 "Settings": {
2528 "Url": "https://www.syncfusion.com/ ",
@@ -38,15 +41,42 @@ curl --location 'http://localhost:8003/v1/conversion/html-to-pdf' \
3841 }
3942 }'
4043
44+ For File
45+
46+ curl --location 'http://localhost:8003/v1/conversion/html-to-pdf ' \
47+ --form-string 'settings={
48+ "JobID": "job-123",
49+ "IndexFile":"index.html",
50+ "PaperSize": "A4",
51+ "Settings": {
52+ "Url": "",
53+ "AdditionalDelay": 500,
54+ "EnableScripts": true,
55+ "EnableLinks": true,
56+ "EnableBookmarks": true,
57+ "EnableForms": false,
58+ "EnableToc": false,
59+ "Margins": 24,
60+ "Rotation": 0,
61+ "Orientation": "Portrait",
62+ "SinglePagePdf": false,
63+ "ShowHeader": true,
64+ "ShowFooter": true
65+ }
66+ }'
67+
4168{% endhighlight %}
4269
4370{% highlight javaScript tabtitle="JavaScript" %}
4471
72+ For Url
73+
4574const formdata = new FormData();
4675formdata.append(
4776 "settings",
4877 JSON.stringify({
4978 JobID: "job-200",
79+ "IndexFile":"",
5080 PaperSize: "A4",
5181 Settings: {
5282 Url: "https://example.com/invoice/5678 ",
@@ -66,6 +96,33 @@ formdata.append(
6696 })
6797 );
6898
99+ For File
100+
101+ const formdata = new FormData();
102+ formdata.append(
103+ "settings",
104+ JSON.stringify({
105+ JobID: "job-200",
106+ "IndexFile":"index.html",
107+ PaperSize: "A4",
108+ Settings: {
109+ Url: "",
110+ AdditionalDelay: 800,
111+ EnableScripts: true,
112+ Enablelinks: true,
113+ EnableBookmarks: true,
114+ EnableForms: false,
115+ EnableToc: false,
116+ Margins: 24, // points
117+ Rotation: 0,
118+ Orientation: "Portrait", // or "Landscape"
119+ SinglePagePdf: false,
120+ ShowHeader: true,
121+ ShowFooter: true
122+ }
123+ })
124+ );
125+
69126const requestOptions = {
70127 method: "POST",
71128 body: formdata,
@@ -84,9 +141,13 @@ fetch("http://localhost:8003/v1/conversion/html-to-pdf", requestOptions)
84141var client = new HttpClient();
85142var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost:8003/v1/conversion/html-to-pdf ");
86143var content = new MultipartFormDataContent();
144+
145+ For Url
146+
87147var settings = new
88148{
89149 JobID = "job-300",
150+ "IndexFile":"",
90151 PaperSize = "A4",
91152 Settings = new
92153 {
@@ -106,6 +167,32 @@ var settings = new
106167 }
107168};
108169
170+ For File
171+
172+ var settings = new
173+ {
174+ JobID = "job-300",
175+ "IndexFile":"index.html",
176+ PaperSize = "A4",
177+ Settings = new
178+ {
179+ Url = "",
180+ AdditionalDelay = 700,
181+ EnableScripts = true,
182+ Enablelinks = true,
183+ EnableBookmarks = true,
184+ EnableForms = false,
185+ EnableToc = false,
186+ Margins = 24,
187+ Rotation = 0,
188+ Orientation = "Portrait",
189+ SinglePagePdf = false,
190+ ShowHeader = true,
191+ ShowFooter = true
192+ }
193+ };
194+
195+
109196content.Add(new StringContent(JsonSerializer.Serialize(settings)), "settings");
110197request.Content = content;
111198
0 commit comments