I am trying to export a GraphicsGrid
to a PDF such that the PDF has a size of 8x10 inches and a resolution of 300 dpi. Here is what I have done:
Create the graphics grid with
ImageSize->Full
to get all the images placed in the grid correctly.Rasterize it to RasterSize 300{8,10}.
grid = Rasterize[
GraphicsGrid[{
{fiberAndReferencePlot},
{transmissionPlot},
{summaryPlotRadians}
},
ImageSize -> Full
],
RasterSize -> 300 {8, 10}
]
- Export it to the correct size 8x10.
Export["Grid.pdf", grid, ImageSize -> 72 {8, 10}]
When I look at the PDF with Photoshop, it tells me that the image size in pixels is 2400x3000, which is correct. But the size in inches is 6.3 x 7.875, which is not the 8 x 10 I expected.
Can anyone tell me how to do this properly?
EDIT:
Here is something else I tried. I create a rasterized image of the desired pixel dimensions. Then I export telling export the ImageResolution is 300. I hoped that export would then respect the size of the raster, and calculate an image size in inches based on the specified image resolution.
im1 = Plot[Sin[x], {x, 0, 4 Pi}, Frame -> True, PlotLabel -> "Sin(x)",
FrameLabel -> {"Angle", "Value"}];
g = GraphicsGrid[{{im1}, {im1}, {im1}}];
gr = Rasterize[g, RasterSize -> 1500];
Dimensions@ImageData@gr
(* {2696,1500,3} *)
pdf = Export["gr.pdf", gr, ImageResolution -> 300];
When I look at the exported PDF with Photoshop, it tells me the PDF has a size of 1080 x 1941 pixels in 3.6 x 6.47 inches. This does not seem to have any relationship to what I wanted.
What I am trying to do should be very simple. I want to take a graphic displayed on the screen and export it at a specific resolution and image size.
Export
as PDF is assuming the print environment, which applies a number of different styles/options. The only way you can get what you are looking for is by using Save Selection As > PDF. Please report this to support and I'll look into more. $\endgroup$