montageTwoPdfs

Return to directory of Todd's CASA extensions

Takes two PDFs of equal page length, converts each page to pngs, and places them side-by-side on each page. Requires pdftk and ImageMagick. See also montageTwoPngLists.

Usage:

au.montageTwoPdfs(pdf1, pdf2, sidebyside=True, pdfname='', cleanup=True, maxpages=-1)
Inputs:
  • pdf1: name of first PDF
  • pdf2: name of second PDF
  • pdfname: name of output PDF

Example:

CASA <2>: au.montageTwoPdfs('findContinuum.testing.2016jan02.pdf','findContinuum.testing.pdf',sidebyside=False,pdfname='2016jan02_vs_now.pdf',cleanup=False,maxpages=2)                                                                                                                                           
Will compare 2 pages (out of 54 and 55)                                                                                                                  
pdflist1 =  ['findContinuum.testing.2016jan02_page001.pdf', 'findContinuum.testing.2016jan02_page002.pdf']                                               
pdflist2 =  ['findContinuum.testing_page001.pdf', 'findContinuum.testing_page002.pdf']                                                                   
Making 2 pages                                                                                                                                           
Running montage -trim -background black -tile 1X2 -geometry 1000x500+2+2  findContinuum.testing.2016jan02_page001.pdf findContinuum.testing_page001.pdf  2016jan02_vs_now.page000.pdf                                                                                                                             
Running montage -trim -background black -tile 1X2 -geometry 1000x500+2+2  findContinuum.testing.2016jan02_page002.pdf findContinuum.testing_page002.pdf  2016jan02_vs_now.page001.pdf                                                                                                                             
Pruned list =  ['2016jan02_vs_now.page000.pdf', '2016jan02_vs_now.page001.pdf']
Checking if I have write privilege on ..                                       
Running command = pdftk 2016jan02_vs_now.page000.pdf 2016jan02_vs_now.page001.pdf cat output ./2016jan02_vs_now.pdf
PDF left in ./2016jan02_vs_now.pdf      
ToddHunter - 2016-01-06
Topic revision: r1 - 2016-01-06, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback