2

I'm trying to create a PDF with a custom page size. Basically, I'm converting a set of JPEGs which are exactly 5:4 dimensions into a single PDF, so I wanted to set the paper size to 8x10, so as not to have "letterbox-type" borders on the top and bottom of the PDF pages. The purpose is for viewing on-screen, not for printing, and these are personal documents which I am not sharing, so there is no need to worry about printability.

I'm using a consumer-grade HP LaserJet printer (P1102W), whose driver apparently "does not support" custom paper sizes. This is evidenced by the fact that I am unable to choose the option to "manage custom sizes" in the paper size list - it is grayed out.

Researching around the Internet seems to reveal that only certain drivers actually will let you configure a custom page size. To experiment, in TextEdit (which does have the Page Setup option), I was able to configure a custom page size. However, Preview does not have a Page Setup option. I've also seen screenshots where certain HP drivers do enable this option, but I obviously don't know which ones, nor do I have the corresponding printer or driver on my system.

I tried installing a generic PostScript printer driver by entering a nonexistent IP into the network printer settings, but even then I was unable to set the custom page size.

Is there any solution I can use to accomplish this? Remember, the goal is to produce a PDF file with a custom page size to eliminate borders, and that PDF will never need to be printed. It seems silly to be limited by the printer driver when the goal is to produce a generic PDF...

Thanks!

EDIT: Ghostscript may be able to do this, but there's something wrong with either my installation or with the Ghostscript that Homebrew installed.

I created a PDF with Preview that had borders, and am now trying to use GS to change the page size. Here's the result:

Mac-mini:~ fmillion$ gs -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=720 -dFIXEDMEDIA -c "<</PageOffset [0 36]>> setpagedevice" -o test1.pdf test.pdf 
GPL Ghostscript 9.14 (2014-03-26)
Copyright (C) 2014 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
**** Unable to open the initial device, quitting.

If I do not include the "-c" option along with its parameter, the operation succeeds, but I end up with a page with a half inch at the bottom and the top half inch of the page cut off. The idea of the PageOffset command was to shift the entire page down by 36 points, thus eliminating the bottom border.

I'm using the Ghostscript provided by Homebrew, simply installed with "brew install ghostscript".

1

It is possible to convert images to PDFs without 'placing them on a default page', so that each page will be whatever size the image is.

There is a collection of python scripts and Automator Actions here, which include one to batch convert images to PDF in that way.

https://github.com/benwiggy/PDFsuite

0

One possibility would not care about the borders, and then crop the pages accordingly (for example in Acrobat; I am not sure whether Preview.app can crop, but worth a try).

  • Preview can crop jpeg images but it won't do anything to change the actual layout of a PDF document, i.e. it won't change the page sizes to match. Acrobat is an awfully expensive solution for a task this simple... I do have UNIX background, so is there maybe a way to do this with Ghostscript? (I have it installed with Homebrew but not very familiar with it...) – fdmillion Aug 14 '14 at 9:37
  • I am not sufficiently familiar with Ghostscript to decide whether it can either crop or force custom paper sizes; you'd have to try it out. – Max Wyss Aug 14 '14 at 13:37
0

I had no problem at all setting a custom page size in preview using the Paper Size command in the print dialog. Just set the size and then use the pull down menu on the bottom left to open the PDF in Preview at the custom size.

  • Was this on Mavericks? This question is 4 years old so posting screenshots would improve your answer. – fsb Mar 20 '18 at 4:08
0

Though this question is quite old, I still had this same problem on High Sierra and found a solution that worked for me.

Since the custom size availability is apparently controlled by the printer drivers, and buying a new printer was out of the question for me, I simply downloaded "Additional Tools for Xcode 10" from Apple's developer site.

*Please note that you will need a developer id (which uses your apple id) to download these tools. You can get one for free at their site.

This toolkit contains an app called "Printer Simulator", Launch it and you will now see new printers available in Preview:

enter image description here

Select one and then you will have custom sizes available again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .