File tree Expand file tree Collapse file tree 3 files changed +19
-15
lines changed Expand file tree Collapse file tree 3 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ app.set("view engine", "ejs");
13
13
app . use ( bodyParser . urlencoded ( { extended : true } ) ) ;
14
14
app . use ( express . static ( "public" ) ) ;
15
15
16
- const apiKey = "c7d40af634094a53a02a542268b9f073 " ;
16
+ const apiKey = "f8f19f5552fe4a64a5bd79038933bb05 " ;
17
17
18
18
// All the get request to render differrent page.
19
19
Original file line number Diff line number Diff line change 221
221
referrerpolicy =" no-referrer"
222
222
></script >
223
223
224
- <script >
225
- window .onload = function () {
226
- const btn = document .getElementById (" downloadBtn" );
227
- btn .addEventListener (" click" , () => {
228
- const menu = this .document .getElementById (" result" );
229
- const options = {
230
- filename: " menu.pdf" ,
231
- image: { type: " jpeg" , quality: 0.98 },
232
- jsPDF: { format: " letter" , orientation: " landscape" },
233
- };
234
- html2pdf ().from (menu).set (options).save ();
235
- });
236
- };
237
- </script >
224
+ <script >
225
+ window .onload = function () {
226
+ const btn = document .getElementById (" downloadBtn" );
227
+ btn .addEventListener (" click" , () => {
228
+ const menu = this .document .getElementById (" result" );
229
+ const options = {
230
+ filename: " menu.pdf" ,
231
+ image: { type: " jpeg" , quality: 0.98 },
232
+ jsPDF: { format: " letter" , orientation: " landscape" },
233
+ };
234
+ html2pdf ().from (menu).set (options).save ();
235
+ });
236
+ };
237
+ </script >
238
238
</body >
239
239
</html >
Original file line number Diff line number Diff line change 193
193
></script >
194
194
195
195
<script >
196
+ useCORS: true ;
197
+
196
198
window .onload = function () {
197
199
const btn = document .getElementById (" downloadBtn" );
198
200
btn .addEventListener (" click" , () => {
199
201
const recipe = this .document .getElementById (" meals" );
200
202
const options = {
203
+ margin: 0 ,
201
204
filename: " recipe.pdf" ,
202
205
image: { type: " jpeg" , quality: 0.98 },
206
+ html2canvas: { scale: 2 , useCORS: true },
203
207
jsPDF: { format: " letter" , orientation: " landscape" },
204
208
};
205
209
html2pdf ().from (recipe).set (options).save ();
You can’t perform that action at this time.
0 commit comments