Graphics, Figures & TablesChange bounding box size in .pdf image

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Change bounding box size in .pdf image

Post by Eenzc »

Hello,

I have been using a program called DipTrace to draw a simple circuit diagram. Unfortunately the program does not have any image export functions so to preserve the diagrams vector format I printed the document to a .pdf using cutepdfwriter.

This has given me an A4 sized page with the image in the bottom left and corner.

I would like to include this image in my latex file however I don't know how to change the size of the pdf without converting it to a raster image and thus losing the vector format which makes it look not as nice in my document.

Any ideas?

Thanks in advance.


The .pdf is attached.
Attachments
taest1.pdf
(2.91 KiB) Downloaded 352 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Change bounding box size in .pdf image

Post by localghost »

There are two possible solutions.
  1. Cut the actual diagram to size by using the Perl script pdfcrop. For Windows you can get a Perl interpreter for free from ActiveState.
  2. Use the clip or viewport option of the \includegraphics command from the graphicx package to show only the relevant part of the PDF file.
The Perl script can be installed with the package manager of your LaTeX distribution.

For such diagrams pgf/tikZ might be an interesting alternative for you.


Best regards
Thorsten¹
Eenzc
Posts: 48
Joined: Thu Jun 26, 2008 2:38 pm

Re: Change bounding box size in .pdf image

Post by Eenzc »

Thanks, I downloaded that perl script and called it on my .pdf file with --margins 10 and it magically worked. I didn't really understand why it worked because initally I tried the --bbox command but that didnt' seem to work. I'm not complaining but it would have been nice to know why --margins 10 worked.

In the help it said the the units were in bp or something .. I had expected pixels and just put in 10 as an arbitrary figure to see if it would extend the margins 10 pixels, it infact just shrunk the bbox approprately so I used it.

Anyway thanks again.
Post Reply