# How to Retain Frame Color when Saving as PDF

Alright, so I am trying to export a homework assignment in full color. I tried simply saving as a pdf, however I lost my frame color. Is there a SetOptions[] command that I am missing to retain this color seen in the first image?

Image 1^^

Image 2^^

Image 3^^

Thanks, I appreciate any help with this issue.

• For one I'd report this as a bug to Wolfram – user6014 Sep 1 '18 at 2:35

When saving to PDF, Mathematica uses the Printout ScreenStyleEnvironment. So, if you want to see what the PDF will look like, you should switch to the Printout environment by using the menu item Format | Screen Environment | Printout. If you do this, you will see that the colors in the Printout environment are what you see in the PDF document.

The above explains why the colors are different. To change this, you can either force the document to be saved using the Workout environment, or you can modify the stylesheet. I will show how to change the stylesheet. First, let's see what the changes are to the "Section" style when you switch environments. Here is the Workout environment "Section" CellFrameColor option:

CurrentValue[
EvaluationNotebook[],
{StyleDefinitions,{"Section", "Working"}, CellFrameColor}
]


RGBColor[0.500008, 0.500008, 0.749996]

And here is the Printout environment "Section" CellFrameColor option:

CurrentValue[
EvaluationNotebook[],
{StyleDefinitions, {"Section", "Printout"}, CellFrameColor}
]


GrayLevel[0.6]

Go to the style sheet (using Format | Edit Stylesheet...) and in the "Enter a style name" input field, type Section. You should see something like:

Use the menu item Cell | Show Expression (or the equivalent keyboard shortcut) on the Section cell:

Change it to something like:

Cell[StyleData["Section", "Printout"],
CellFrameColor -> RGBColor[0.500008, 0.500008, 0.749996]
]


Use Cell | Show Expression again to toggle back, and then your Printout environment will now have the same color Section frame as in the Working environment. This should cause the PDF to use those colors as well.

• Thanks! This did the charm! One slight catch though. When I toggle back into the working screen environment, the frame color is now reverted back to default. This is not the end of the world, because it prints out the way I want. Any thought as to how to have it look correct in both places? Thanks. – MGoforth Sep 2 '18 at 13:40
• Much simpler is to set PrintingStyleEnvironment to "Working". – Alexey Popkov Sep 16 '18 at 9:07