LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-16-2016, 12:37 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Rep: Reputation: 213Reputation: 213Reputation: 213
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
 
Old 09-16-2016, 01:01 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,567

Rep: Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093Reputation: 2093
How about "imagemagick -trim"?
 
Old 09-17-2016, 06:14 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by rknichols View Post
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!!
 
Old 09-17-2016, 07:33 AM   #4
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Apples
Distribution: Apple-selling shops, markets and direct marketing
Posts: 1,210
Blog Entries: 32

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
 
Old 09-24-2016, 11:45 AM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by Michael Uplawski View Post
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I trim silent portions of a video automatically? gustywind Linux - Software 4 04-14-2014 05:45 PM
[SOLVED] Mencoder yields 2GB output without crop, 2MB output with crop porphyry5 Linux - Software 2 01-11-2012 06:44 AM
howto scan and crop to image size automatically SaintDanBert Linux - Desktop 4 08-20-2010 04:08 AM
Kwrite's Xs in the margin newbiesforever Linux - Software 1 12-14-2006 10:20 AM
Edge (margin) on X jayprakash Linux - Software 0 04-10-2006 05:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration