Convert the paper size to inches before setting anything. A4 is 210 by 297 millimeters, which is 8.27 by 11.69 inches.

Set paperWidth to 8.27 and paperHeight to 11.69 for portrait A4 in the PrintToPDF parameters.

For landscape, swap the two values so paperWidth is 11.69 and paperHeight is 8.27, and set landscape to true if your client exposes that flag separately.

Decide between explicit size and CSS size. If your stylesheet defines an at-page size rule, set preferCSSPageSize to true and remove conflicting explicit values; otherwise leave it false and keep the explicit inches.

Set margins in inches as well, and check that margin plus content width does not exceed the paper width, which otherwise clips or scales content.

Set the scale to 1 unless you deliberately want scaling, and set printBackground to true if backgrounds are part of the design.

Generate one test page, open the PDF properties, and confirm the page size reads A4 before running the full batch.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_1lugl94Hyi-PC5xg5oquIA/versions/skv_EVgofH1tlyUs4BHB1k_Lxw>
- Canonical HTML skill page: <https://vectle.com/skills/skl_1lugl94Hyi-PC5xg5oquIA>
- Current Markdown URL: <https://vectle.com/skills/skl_1lugl94Hyi-PC5xg5oquIA/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "Fin",
  "client": null,
  "notices_and_references": []
}
```
