2
$\begingroup$

The following code produces very different PDF outputs in versions 7 and 10. Is there some way to make Mathematic 10 produce the same print output as Mathematica 7?

(* Temporary session page settings *)
SetOptions[$FrontEndSession,
 PrintingOptions -> {
   "PrintingMargins" -> {{45, 43}, {17, 31}},
   "FirstPageHeader" -> False,
   "FirstPageFooter" -> False,
   "RestPagesHeader" -> False,
   "RestPagesFooter" -> False,
   "Magnification" -> 1}]

text = StringReplace[StringTake[ExampleData[{"Text", "Prufrock"}], 4221],
   FromCharacterCode[{195, 162, 128, 194}] -> "'"];

square = Graphics[{Orange, Rectangle[{0, 0}, {70, 70}]}, PlotRange -> {{0, 70}, {0, 70}}];

column = Table[Inset[square, {415, 100 i}, {Left, Bottom}, {70, 70}], {i, 0, 9}];

page = Graphics[{White, Rectangle[{0, 0}, {500, 973}], Black,
    Inset[TextCell[text, LineSpacing -> {0, 16}, TextJustification -> 1],
     {0, 973}, {Left, Top}, {400, 973}], column},
   PlotRange -> {{0, 500}, {0, 973}}, ImageSize -> 500,
   BaseStyle -> {FontFamily -> "Times", FontWeight -> "Plain", FontSize -> 14}];

nb = CreateDocument@ExpressionCell[page, "Print"];

filename = StringJoin["v", ToString[Round@$VersionNumber], ".pdf"];

Quiet@DeleteFile[filename];

Export[filename, nb];

NotebookClose[nb]

Output Comparison

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

Changes to PrintingMargins, LineSpacing, ImageSize and FontSize got the version 10 output close to the version 7 original. However changing font size is not evenly scalable.

Trying with Magnification didn't help. Best would be to replicate the versions 7 "Printout" style environment, but this doesn't seem to be open to manipulation.

(* Temporary session page settings *)
SetOptions[$FrontEndSession,
 PrintingOptions -> {
   "PrintingMargins" -> {{11, 43}, {15, 31}},
   "FirstPageHeader" -> False,
   "FirstPageFooter" -> False,
   "RestPagesHeader" -> False,
   "RestPagesFooter" -> False,
   "Magnification" -> 1}]

text = StringReplace[StringTake[ExampleData[{"Text", "Prufrock"}], 4221],
   FromCharacterCode[{195, 162, 128, 194}] -> "'"];

square = Graphics[{Orange, Rectangle[{0, 0}, {70, 70}]}, PlotRange -> {{0, 70}, {0, 70}}];

column = Table[Inset[square, {415, 100 i}, {Left, Bottom}, {70, 70}], {i, 0, 9}];

page = Graphics[{White, Rectangle[{0, 0}, {500, 973}], Black,
    Inset[TextCell[text, LineSpacing -> {0, 17}, TextJustification -> 1],
     {0, 973}, {Left, Top}, {400, 973}], column},
   PlotRange -> {{0, 500}, {0, 973}}, ImageSize -> 555,
   BaseStyle -> {FontFamily -> "Times", FontWeight -> "Plain", FontSize -> 15.5}];

nb = CreateDocument@ExpressionCell[page, "Print"];

filename = StringJoin["v", ToString[Round@$VersionNumber], ".pdf"];

Quiet@DeleteFile[filename];

Export[filename, nb];

NotebookClose[nb]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.