Reordering pages in PDFs?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Reordering pages in PDFs?
I don't know if this is possible in LiveCode - but almost everything seems to be, so here goes:
Can LiveCode be used to take an existing multiple-page PDF and change the page order?
I'll happily experiment until the cows come home, but if anyone can say categorically no I'll give up now. Otherwise, any suggestions for where I should start looking?
k
Can LiveCode be used to take an existing multiple-page PDF and change the page order?
I'll happily experiment until the cows come home, but if anyone can say categorically no I'll give up now. Otherwise, any suggestions for where I should start looking?
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Reordering pages in PDFs?
Hi Keith,
no!
The "Business" edition comes with a PDF reader external, but I don't think this can reorder the pages in PDFs.
Take a look here: https://livecode.com/products/livecode- ... df-viewer/
Best
Klaus
no!
The "Business" edition comes with a PDF reader external, but I don't think this can reorder the pages in PDFs.
Take a look here: https://livecode.com/products/livecode- ... df-viewer/
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Reordering pages in PDFs?
Hah! Damn.
I have LC Business, but it sounds like the PDF features aren't quite all-powerful. Hmm...
I wonder, can PDFs be shown within a card and included in the output when printing, using the actual PDF data not a bitmap graphic render? It'd be a fairly funky workaround, but I could try making cards for PDF page spreads and 'print' a new PDF out... (can you tell I'm new to working with these things in LC?
Or I could use AppleScript to drive Preview to do the job. But that seems less elegant.
k
I have LC Business, but it sounds like the PDF features aren't quite all-powerful. Hmm...
I wonder, can PDFs be shown within a card and included in the output when printing, using the actual PDF data not a bitmap graphic render? It'd be a fairly funky workaround, but I could try making cards for PDF page spreads and 'print' a new PDF out... (can you tell I'm new to working with these things in LC?
Or I could use AppleScript to drive Preview to do the job. But that seems less elegant.
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Reordering pages in PDFs?
Hi Keith,
sorry, I only have an Indy licence, so I cannot give any adsvice regarding LC & PDF here.
AppleScript and Preview is surely a solution, but, as you mentioned, not the most elegant one.
Best
Klaus
sorry, I only have an Indy licence, so I cannot give any adsvice regarding LC & PDF here.
AppleScript and Preview is surely a solution, but, as you mentioned, not the most elegant one.
Best
Klaus
Re: Reordering pages in PDFs?
PDFtk, a command line utility (that you can run from a LiveCode script)
is ideal for this task. The solution posted in this message from Ubuntu
forums is effectively a single line:
pdftk theoriginalfile.pdf cat 1 4 19 16 22 13 7 10 2 5 20 17 23 14 8 11 3 6 21 18 24 15 9 12 25 output thenewfile.pdf
Read the whole message thread visiting this link
https://ubuntuforums.org/showthread.php?t=868950
is ideal for this task. The solution posted in this message from Ubuntu
forums is effectively a single line:
pdftk theoriginalfile.pdf cat 1 4 19 16 22 13 7 10 2 5 20 17 23 14 8 11 3 6 21 18 24 15 9 12 25 output thenewfile.pdf
Read the whole message thread visiting this link
https://ubuntuforums.org/showthread.php?t=868950
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Reordering pages in PDFs?
It looks like a perfect solution! Thanks, this feels like a good way forward.
k
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Reordering pages in PDFs?
Glad to help!
Re: Reordering pages in PDFs?
HI Capellan
I just recently discovered PDFTK but not sure how to launch it using the shell command.
My goal is to just do a wild card of the files in a folder which the user select and the resulting Merged PDF name got from a user using the "ask" command.
I am a LC newbie
Here is my code:
I am not sure how to use the variable in the shell command.
Any suggestions would be appreciated.
Many thanks
Peter G
I just recently discovered PDFTK but not sure how to launch it using the shell command.
My goal is to just do a wild card of the files in a folder which the user select and the resulting Merged PDF name got from a user using the "ask" command.
I am a LC newbie
Here is my code:
Code: Select all
ask question "Type in the name of the file. (name.PDF)" titled "Merge File Name"
put it into gFilename
get shell( "pdftk *.pdf output combined.pdf")
end mouseUp
Any suggestions would be appreciated.
Many thanks
Peter G
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Reordering pages in PDFs?
Hi Peter,
The thread http://forums.livecode.com/viewtopic.php?f=9&t=29445 has some example scripts from something I'm working on that use both pdftk and pdfjam, along with some very helpful scripts for handling paths with spaces when setting up a more complex quoted command for shell() to use. Let me know if you want some sample scripts for pdftk.
k
The thread http://forums.livecode.com/viewtopic.php?f=9&t=29445 has some example scripts from something I'm working on that use both pdftk and pdfjam, along with some very helpful scripts for handling paths with spaces when setting up a more complex quoted command for shell() to use. Let me know if you want some sample scripts for pdftk.
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Reordering pages in PDFs?
My apologies for only replying now.
Was a bit out of action.
This link was most helpful.
Many Thanks
Peter G
Was a bit out of action.
This link was most helpful.
Many Thanks
Peter G