-1

I'm totally new to programming and I need to convert an .sh file to a .py file.

In this line:

pdfnup --nup 1x2 --no-landscape --scale 0.95 --suffix 'D' Lecture_0-D.pdf

How can we provide scaling in python pdfnup?

f-CJ
  • 4,235
  • 2
  • 30
  • 28
  • You might want to checkout [this related post](https://stackoverflow.com/questions/89228/calling-an-external-command-in-python) – 5422m4n Sep 06 '19 at 15:35

1 Answers1

0

I haven't used it myself, but from the pdfnup examples:

You can use pdfnup as a Python module e.g. like in the following interactive Python session:

>>> from pdfnup import generateNup
>>>
>>> generateNup("file.pdf", 8, verbose=True)
written: file-8up.pdf

So presumably you could do this:

generateNup('Lecture_0-D.pdf', nup='1x2', no_landscape=True, scale=0.95, suffix='D')

But check generateNup's documentation about parameters to be sure.

Community
  • 1
  • 1
wjandrea
  • 28,235
  • 9
  • 60
  • 81