LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to crop/trim margin automatically ? (https://www.linuxquestions.org/questions/linux-software-2/how-to-crop-trim-margin-automatically-4175589571/)

Xeratul 09-16-2016 01:37 PM

How to crop/trim margin automatically ?
 
Hello

I have converted a slide of powerpoint from PPT to PDF.

Now I need to get a bash script that will detect the margin and remove the empty margins.

pdfcrop is in extras of latex, but pdfcrop "myfile.pdf" does not do that automatically (to detect the white margins).


Would you know a cool tool that would perform this?

thank you

rknichols 09-16-2016 02:01 PM

How about "imagemagick -trim"?

Xeratul 09-17-2016 07:14 AM

Quote:

Originally Posted by rknichols (Post 5606168)
How about "imagemagick -trim"?

no no, you loose of the quality of your image. You get really a better pdf quality with other stuffs than imagemagick.


the best is as follows. open wine and powerpoint, place the image to the lower bottom/right side of the slide, and run
Code:

pdfcrop mypptfile.ppt
you will get the file mypptfile.pdf and you can easily compile your document with the new created pdf.

You can use libreoffice headless + pdfcrop with a macro in latex, and you have both powerpoint and latex at the same time just using linux and wine hq!!

Michael Uplawski 09-17-2016 08:33 AM

You can however convert all pages of the PDF to a tiff of your preferred quality, either with ghost-script or convert, then apply convert -trim anyway and re-create your PDF file with tiff2pdf. No wine- or LibreOffice-tricks are needed. The quality is under your control.

Xeratul 09-24-2016 12:45 PM

Quote:

Originally Posted by Michael Uplawski (Post 5606456)
You can however convert all pages of the PDF to a tiff of your preferred quality, either with ghost-script or convert, then apply convert -trim anyway and re-create your PDF file with tiff2pdf. No wine- or LibreOffice-tricks are needed. The quality is under your control.

I have managed to trim the pdf with pdfcrop myconvertedppttopdf.pdf !!

I just had to bring the stuffs into the ppt to the lower part and pdfcrop trim it.

It seems that pdfcrop start from top/left and goes down (it trims the white starting from top/left)


All times are GMT -5. The time now is 08:33 PM.