Skip to content

Commit 3e325f5

Browse files
committed
491995 : Updated html to pdf with assets in JS and C#
1 parent a6248f1 commit 3e325f5

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

Document-Processing/Web-apis/consume-apis/html-to-pdf.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,28 @@ formdata.append(
160160
"settings",
161161
JSON.stringify({
162162
JobID: "job-200",
163-
"IndexFile":"index.html",
163+
IndexFile: "index.html",
164+
Assets: ["image1.jpeg", "style.css"],
164165
PaperSize: "A4",
165166
Settings: {
166167
Url: "",
167168
AdditionalDelay: 800,
168169
EnableScripts: true,
169-
Enablelinks: true,
170+
EnableLinks: true,
170171
EnableBookmarks: true,
171172
EnableForms: false,
172173
EnableToc: false,
173-
Margins: 24, // points
174+
Margins: 24,
174175
Rotation: 0,
175-
Orientation: "Portrait", // or "Landscape"
176+
Orientation: "Portrait",
176177
SinglePagePdf: false,
177178
ShowHeader: true,
178179
ShowFooter: true
179-
}
180+
},
181+
AssetMap: [
182+
{ saveAs: "image1.jpeg", original: "image1.jpeg" },
183+
{ saveAs: "style.css", original: "style.css" }
184+
]
180185
})
181186
);
182187

@@ -201,15 +206,16 @@ var content = new MultipartFormDataContent();
201206

202207
var settings = new
203208
{
204-
JobID = "job-300",
205-
"IndexFile":"index.html",
209+
JobID = "job-300",
210+
"IndexFile" = "index.html",
211+
Assets = new[] { "image1.jpeg", "style.css" },
206212
PaperSize = "A4",
207213
Settings = new
208214
{
209215
Url = "",
210-
AdditionalDelay = 700,
216+
AdditionalDelay = 700,
211217
EnableScripts = true,
212-
Enablelinks = true,
218+
EnableLinks = true,
213219
EnableBookmarks = true,
214220
EnableForms = false,
215221
EnableToc = false,
@@ -219,6 +225,11 @@ var settings = new
219225
SinglePagePdf = false,
220226
ShowHeader = true,
221227
ShowFooter = true
228+
},
229+
AssetMap = new[]
230+
{
231+
new { saveAs = "image1.jpeg", original = "image1.jpeg" },
232+
new { saveAs = "style.css", original = "style.css" }
222233
}
223234
};
224235

0 commit comments

Comments
 (0)