"Go" PDF file Auto Chebai Edge

Source: Internet
Author: User

Automatic clipping of PDF files (auto Chebai edge)

From:http://www.ai7.org/wp/html/754.html

possible environment, tools: Ubuntu 10.04+texlive 2008+pdfcrop+cups print driver, with Windows Brothers do not have to look, these tools are theoretically under Windows, but also have a lot of other things.

The following assumes that the original file (that is, the file intended to Chebai side) is called Abc.pdf

    1. Pdfcrop Abc.pdf, the default is to generate Abc-crop.pdf files, this is already cut off the white edge, if you do not think it big (or it is really small), it is finished.
    2. Open abc-crop.pdf with a reader (such as evince) and print to a file through cups, pay attention to closing all commands related to page scaling and check "use document page size as page size". Print, Finish.

Description

    1. Pdfcrop is actually brought by Texlive. is essentially a Perl script.
    2. Pdfcrop to call GS (Ghostscript) to determine the white edge size of each page. For blank pages, the error will be ignored.
    3. Pdfcrop can also leave a few pixels at the time of cutting, specifically please help.
    4. Pdfcrop to call pdfTeX to generate the file after the Chebai edge.
    5. Pdfcrop in essence (conjecture, no reading source) is the first to expand the abc.pdf into a single-page PDF, call the GS Chebai side, and then use Tex file directly to call the PDF page, and finally generate output with pdfTeX.
    6. Pdfcrop directly generated files are generally more than 20 times times the original file (I test several files are so), virtual printing to a new file, the basic can be restored to the same order of magnitude of the original file size.
    7. The tests are both in English and Chinese PDF using the inline fonts. Scan version of the trial, the estimate is too tough.

With a similar EPS version tool

First use the following command to remove the white edge. Because it is a program to do, the effect of removing white edges is even better than the person himself:

Epstool--copy--bbox input_file.eps input_file_temp.eps

The second and final step is to convert the EPS image to PDF and only one line of command

Epstopdf--hires--outfile=output.pdf Input_file_temp.eps

This completes the conversion of EPS to PDF.

The above procedure can be written as a script

Epstool--copy--bbox $ my_epstopdf_temp.eps

Epstopdf--hires--outfile=$2 My_epstopdf_temp.eps

RM my_epstopdf_temp.eps

"Go" PDF file Auto Chebai Edge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.