I want for example export a simple plot to a PDF file. The paper orientation should be portrait and the printing margings should have a certain value.
I tried the following:
p = Plot[Sin[x], {x, 0, 2 Pi}];
Export[StringJoin["Sin.pdf"], p, "PDF",
PrintingOptions -> {"PrintingMargins" -> {{300, 300}, {300, 300}},
"PaperOrientation" -> "Portrait"}];
but it gives me the follwing image of the PDF file which is not portrait and has no margins:

Exportcommand. – lio Mar 22 '17 at 10:22Exportis a bit weird. The allowed options are different for each format, and it does not always warn if some incorrect option names are given. It just ignores them. – Szabolcs Mar 22 '17 at 10:23Plot[Sin[x], {x, 0, 10}, ImageSize -> Full], then File -> Save As... and save the notebook as PDF. This could be automated. Notebooks (handles like the one returned byEvaluationNotebook[], or explicitNotebookexpressions) can be exported to PDF withExport. In this case the page size matters.ImageSize -> Fullmakes the figure as wide as the available space. There would be more work to remove the cell labels, and I do not know how to centre vertically. – Szabolcs Mar 22 '17 at 10:49