Is there a way to fix the cut off text in a PDF file?

I have a library guide that the creator modified with some LaTeX code and changed the position and size of the page, but didn't check it before compiling, distilling and submitting. It is currently unavailable, so if I want to print it I have to fix it myself.

I was able to use some of the ghostscript commands to make all the text go to something near the center of the page, the command is shown below:

/usr/bin/gs -sDEVICE=pdfwrite -o /home/user/shiftdown.pdf -dPDFSETTINGS=/prepress -c "<</PageOffset [0 -35]>> setpagedevice" -f /home/user/brokendoc.pdf

      

The problem is that while the page is now printable without hitting the hardware margins, the section headers are still halfway across the top. If I open the PDF in Acrobat or Reader, I can select a section title and copy it, and it pastes the full text into the program of my choice. When I tried to print it on a XFP Xerox with a partially incompatible driver, it printed a header but it will not be duplex and I dont want to print more than 700 pages and then use the copy in 1 → 2 function.

Does anyone know how to fix these cropped headers so that they either display correctly in the PDF file, or at least print reliably correctly? I have ghostscript readily available, TeX is relatively readily available, and Acrobat X standard edition.

[Update:]

After downloading the Acrobat Pro XI demo, I was able to go to the Print tab and click Modify Object. When I clicked on the cut-off chapters, it showed me two bounding rectangles that covered the entire page with one slightly higher than the other. When I right clicked, I got the Add Clip and Remove Clip options. When I click the Delete Clip button, the entire chapter title is displayed. If I click Add Clip, it says, "There is already a clipping region in one or more of the selected regions. Do you continue to adjust the clipping regions for the selected objects? [No] [Yes]"

With this information added, I know there is an issue in batch mode that fixed the issue, does anyone know what the command translates to this?

+3


source to share


1 answer


Without seeing "brokendoc.pdf" it is difficult to understand. If I see the file, I can tell you what's going on and (possibly) how to fix or work around it.

I don't need the whole file, so a short version containing only a few pages showing the problem is sufficient. You can get this from the full brokendoc.pdf using:
gs -sDEVICE = pdfwrite -o part.pdf -dLastPage = 10 brokendoc.pdf



Alternatively, you can try:
 gs -sDEVICE = pdfwrite -o installed.pdf -dPDFFitPage -sPAPERSIZE = letter -dFIXEDMEDIA brokendoc.pdf

The above scales (and centers) the page to the specified page size. You can specify "letter" or "a4" or use -dMEDIAWIDTHPOINTS = _ -dMEDIAHEIGHTPOINTS = _ to get a specific output page size. The -dFIXEDMEDIA option causes gs to ignore the MediaBox in the file.

+3


source







All Articles