Skip to main content
Update for latest PikePDF
Source Link
hackerb9
  • 1k
  • 10
  • 13

Solution without Adobe Acrobat

Since you mentioned you use Mint, which is based on Debian GNU/Linux, you should be able to do this automatically for PDF files using the pikepdf library (apt install python3-pikepdf) and a little Python.

You just need to add /PageLayout /TwoPageRight to the root of the PDF's document tree. This can be done in Python like so:

from pikepdf import Pdf, Dictionary, Name
pdf=Pdf.open('input.pdf')
pdf.rootRoot.PageLayout=Name('/TwoPageRight')
pdf.save('output.pdf')

But wait, it didn't work!

There's the rub. You can create a PDF which suggests the page layout, but at the time I am writing this (2021) most PDF viewers for GNU/Linux (including evince mentioned in the question) will always override it with the default user preferences.

However, if you send it to someone with Adobe Reader and they have its preferences set to Page Layout: Automatic, it will properly open like a book, with the first page on the right and all following pages side by side.

Solution without Adobe Acrobat

Since you mentioned you use Mint, which is based on Debian GNU/Linux, you should be able to do this automatically for PDF files using the pikepdf library (apt install python3-pikepdf) and a little Python.

You just need to add /PageLayout /TwoPageRight to the root of the PDF's document tree. This can be done in Python like so:

from pikepdf import Pdf, Dictionary, Name
pdf=Pdf.open('input.pdf')
pdf.root.PageLayout=Name('/TwoPageRight')
pdf.save('output.pdf')

But wait, it didn't work!

There's the rub. You can create a PDF which suggests the page layout, but at the time I am writing this (2021) most PDF viewers for GNU/Linux (including evince mentioned in the question) will always override it with the default user preferences.

However, if you send it to someone with Adobe Reader and they have its preferences set to Page Layout: Automatic, it will properly open like a book, with the first page on the right and all following pages side by side.

Solution without Adobe Acrobat

Since you mentioned you use Mint, which is based on Debian GNU/Linux, you should be able to do this automatically for PDF files using the pikepdf library (apt install python3-pikepdf) and a little Python.

You just need to add /PageLayout /TwoPageRight to the root of the PDF's document tree. This can be done in Python like so:

from pikepdf import Pdf, Dictionary, Name
pdf=Pdf.open('input.pdf')
pdf.Root.PageLayout=Name('/TwoPageRight')
pdf.save('output.pdf')

But wait, it didn't work!

There's the rub. You can create a PDF which suggests the page layout, but at the time I am writing this (2021) most PDF viewers for GNU/Linux (including evince mentioned in the question) will always override it with the default user preferences.

However, if you send it to someone with Adobe Reader and they have its preferences set to Page Layout: Automatic, it will properly open like a book, with the first page on the right and all following pages side by side.

Source Link
hackerb9
  • 1k
  • 10
  • 13

Solution without Adobe Acrobat

Since you mentioned you use Mint, which is based on Debian GNU/Linux, you should be able to do this automatically for PDF files using the pikepdf library (apt install python3-pikepdf) and a little Python.

You just need to add /PageLayout /TwoPageRight to the root of the PDF's document tree. This can be done in Python like so:

from pikepdf import Pdf, Dictionary, Name
pdf=Pdf.open('input.pdf')
pdf.root.PageLayout=Name('/TwoPageRight')
pdf.save('output.pdf')

But wait, it didn't work!

There's the rub. You can create a PDF which suggests the page layout, but at the time I am writing this (2021) most PDF viewers for GNU/Linux (including evince mentioned in the question) will always override it with the default user preferences.

However, if you send it to someone with Adobe Reader and they have its preferences set to Page Layout: Automatic, it will properly open like a book, with the first page on the right and all following pages side by side.