1

I do have a pdf that contains a drawing, a part of which I would like to extract.

I am able to open the pdf in inkscape. However, it contains a group with 150k items. As far as I see, there are no subgroups that I could select as entity. Now just trying to select the parts that I would like to delete does not work (inkscape still has 100% CPU load after 3 hours).

Is there a command line tool that would allow me to crop the pdf and to delete the elements that are outside the cropped area? This would then allow me to further edit the extracted section using inkscape.

1 Answer 1

3

if your document (call it doc.pdf) has a sensibly set up MediaBox (otherwise, use your PDF viewer of choice, and print to a PDF file):

mutool trim -m +TOP,+RIGHT,+BOTTOM,+LEFT -o trimmed.pdf doc.pdf 

with TOP, RIGHT,BOTTOM, and LEFT being how much you want to trim on each of these sides in points (1 pt = 0.3528 mm, i.e., 1 mm = 2.83447 pt; sorry for the stupid units).

Note that this can "over-trim", as its designed to remove objects whose origin fall outside the specified region, not to cut polygons "correctly".

mutool is called pdftool on some distributions.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.