Merging PDF pages

panagiotis m merakosp at gmail.com
Fri Aug 25 10:52:55 EDT 2023


Hello all,

There is a built-in utility on MacOS for merging PDFs. You can call it from
"shell", as Paul suggested.

This seems to work - tested on MacOS Mojave. It merges "test1.pdf" and
"test2.pdf" into "merged.pdf" on Desktop.
Just check that the path of tApp actually exists in modern MacOS as well.

on mouseUp pButtonNumber
   local tShell, tApp
   put quote & "/System/Library/Automator/Combine PDF
Pages.action/Contents/Resources/join.py" & quote \
         into tApp
   put tApp && "-o ~/Desktop/merged.pdf ~/Desktop/test1.pdf
~/Desktop/test2.pdf" \
         into tShell
   get shell(tShell)
end mouseUp

Cheers,
Panos
--

On Fri, 25 Aug 2023 at 17:23, Paul Dupuis via use-livecode <
use-livecode at lists.runrev.com> wrote:

> The short answer is NO. There is nothing built into Livecode to take a
> set fo existing PDF files and append them to create a readable PDF that
> is them all stitched together. Neither the XPDF external nor the PDF
> widget will do this.
>
> You best option is to use some 3rd party command line utility that will
> merge PDF files that works on the platform or platforms your want to do
> this on and use the Livecode shell() function to call that command line
> utility.
>
> If this is going to be a distributed standalone, you can actually read
> the utility as a binary file and compress it as a staved property in
> your application, that can uncompress and install it on any target
> computer.
>
> We do this with the popular free open-source video tool ffmpeg for macOS
> and WIndows. Our app install it if needed on the target computer from a
> compressed copy bundled into our app and we use SHELL() to call it to do
> several video operations that can't be done in Livecode.
>
> Paul Dupuis
> Researchware
>
>
>
> On 8/25/2023 9:10 AM, Eller, Roger via use-livecode wrote:
> > It's been a while since I've posted a question here.  Is it possible to
> use livecode script to merge multiple 1-page PDFs into a multipage PDF
> without using Acrobat or other 3rd party software?
> >
> > Thanks.
> >
> > ~Roger
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list