Insert PDF

Good afternoon!

I’m working on a simple ASOC program that the end result produces a 12 or 16 page PDF document. I’ve been doing some looking around as to how to combine PDFs together thru code. I’ve used the Acrobat method where you open document 1, then document 2 and then add document 2’s pages to document 1. However, this is a little time consuming since I’m opening up to 16 pages. Then, I noticed that Smile has a command “Insert PDF” in it’s dictionary, so I’ve tried talking to Smile to do the combining. This does work about twice as fast, but Smile seems somewhat unstable, and I haven’t finished the program yet, so when Smile crashes it really causes a lot more work.

Now, my manager has an idea to use Object C. He knows more about object-oriented programming than I but we both could use some help. I’ve found this in the sample code from the developer documentation:

page = [[CalendarPage alloc] initWithImage: image month: 2];
[_calendarPDF insertPage: page atIndex: 1];
[page release];

I’m guessing that this is what I’m going to need(?):

page = [[CalendarPage alloc]];
[_calendarPDF insertPage: page atIndex: 1];

(of course with my variables instead of Calendar Page)

My question is this: is this the best way to combine PDFs? If so, how can I go about putting in straight Object C into an ASOC project? What about the information in the .h file? Would those just become properties?

Any ideas or guidance would be greatly appreciated!

You’re probably on the right track, but that code ain’t going anywhere :frowning:

You make an Object-C class, and call its methods.

Not sure what you mean.

Well you could always try doing it in ASObjC. This is an ASObjC forum, after all…

Can you give me some suggestions on how to do it in ASObjC? I’m at a loss of ideas here… Insert PDF thru Smile crashes all the time and Acrobat’s way of doing it is very slow.

What sort of PDFs are these?

They are high-res print-ready PDFs of our weekly ad circulars. Is that what you were wanting to know? I know I don’t want a PDF inserted as a graphic and the PDFs need to retain the settings we used to create them.

In that case I’d be leery of shortcuts. They might well work, but I’d be a bit nervous.