I have a column consisting of strings and pictures, like this:
exp = Column[{
Style[ToString["\nInformation sheet\n"], Bold, Large],
figure1,
Style[ToString["\nPlots\n"], Italic],
picture1
}]
but how can I export it such that it automatically inserts a page break after reaching the height of an A4, so that the exported PDF can be printed without hassle?
My own idea was to keep track of the cumulative height, and as soon as it reaches 294mm to create a new PDF and then merge them. *I used this approach and the answers below to get to the following solution, as good as it gets:
x = 1; y = x; l = Max[hs]; separated = {};
If[l <= a4y,
While[y < Length[hs],
While[Total[hs[[x ;; y]]] <= a4y,
y = y + 1];
AppendTo[separated, exp[[x ;; y - 1]]];
x = y];
AppendTo[separated, exp[[x ;; y]]];
(*];*)
PrependTo[separated, {pre, mid1,
meant1rhocol, mid2}];
pm = 72 {{0.5, 0.25}, {0.5, 0.3}};
cd = CreateDocument[
Table[Column[separated[[file]], Alignment -> Left], {file,
Length[separated]}],
"ShowPageBreaks" -> True,
"PageSize" -> {0.5 a4x, a4y},
"PaperSize" -> {a4x, a4y},
ShowStringCharacters -> False,
"PrintingMargins" -> pm,
NotebookFileName -> "Lalala.nb"
Export[ "Lalala.pdf",
cd]
NotebookClose[cd]
where hs is a list of heights, a4y is the height of an A4, exp is a list of images/expressions to print, x and y are used for indexing and separated is a list of separated images*
Also, how large is the Large fontsize expressed in pts or mms?
*EDIT: after some trial and error I found that for Fontsize,
Small = 10
Smaller = Medium = 12
Larger = 16
Large = 24
*
CreateDocument[exp], then print that notebook, as shown here. – MarcoB Jul 15 '15 at 06:39