I have a pdf with something like presentations slides and multiple slides per page. How can I use ghostscript to split the file so that there is one slide per page?
相关问题
- Correctly parse PDF paragraphs with Python
- Set BaseUrl of an existing Pdf Document
- How can I get all text from a PDF in Swift?
- Renaming named destinations in PDF files
- Write multiple lines of text in a flow with report
相关文章
- Python Sendgrid send email with PDF attachment fil
- C# MVC website PDF file in stored in byte array, d
- How To Programmatically Enable/Disable 'Displa
- How to reduce PDF file size programmatically in Ja
- Search and replace placeholder text in PDF with Py
- ITextSharp 4.1.6. PDF Table - how to remove whites
- jsPDF justify text
- Doc4j - Having issues converting docx to PDF with
I would like to propose one solution, that actually
1) splits one PS or PDF page to many separate pages and
2) then merges *.pdf to multipage pdf. But this solution don't process margins.
This script works in Linux BASH:
But we may arrange pages in desired order:
A long time ago I wrote some code for someone on comp.lang.postscript to do this, again it was for PowerPoint slides. This PostScript code assumes that all the 'subpages' (ie slides) are the same size and location on the PDF page and that all the PDF pages are the same size. Save the following as a file called pdf_slice.ps and follow the usage as described in the comments.
The answer of KenS is the one which should be accepted by @howardh. KenS uses a very clever PostScript language program to achieve the result. (Always keep in mind what KenS said: his solution will work well only 'if all the 'subpages' (ie slides) are the same size and location on the PDF page and that all the PDF pages are the same size).
However, for completeness' sake, let me link to a few other previous answers (some of which are illustrated), which solved similar problems:
These answers also use PostScript code, but only as 'snippets' which are passed to Ghostscript on the commandline. (If you are not PostScript-savvy, these may be more easy to modify and adapt for cases where the 'subpages' are not of the same size and location on PDF pages, and where PDF pages are of different sizes.)