Copy link to clipboard
Copied
I've been hitting me head against the wall for a couple of days now and seem to be getting nowhere fast.
I've studied the samples in the SDK and it all seems a bit archaic. There's a whole mess of stuff in those projects that are *very* hard to read and come with no explanation (that I've found); primarily in PIMain.c. If anyone can point to something that would explain the code in that file, I'd be very happy.
There's a bit of black magic everywhere and frankly, I can't seem to figure out why the sample compile fine while my projects don't.
I've tried to doing a simple copy of the Starter sample and adding the missing files that it keeps references to; no luck.
Copy link to clipboard
Copied
If it's any consolation, getting the first project to compile, load, and become a plug-in is usually a painful experience. Crucially DO NOT START AGAIN or try to make a complete project from scratch. Everything in the starter project is there for a reason.
PiMain.c doesn't need to be understood or looked at but it does need to be included in every project. This archaic stuff is simply how it works; you are not writing an executable module, but something that Acrobat has to be able to load using a standard handshaking method, and which has to set up a programming environment where your code calls methods in Acrobat without using any kind of standard linkage.
So, using an existing project is the key. Make sure you are using the version of XCode for which your SDK version is targeted.
The essence is that
1. Acrobat will call your plug-in and run startup code
2. This starter code will register callbacks
3. Acrobat will call your callbacks when events happen
You cannot force this to any other model, like using main() to call API calls, or make an executable. You need to study the events and callbacks available to determine how and when your required code will run.
Copy link to clipboard
Copied
I've read and understood the basic lifecycle of a plugin (pretty basic plugin stuff really) -- that's not my issue.
My problem is that I can't get anything to compile, even when I'm pretty much just copying the starter sample and fixing paths/copying missing files. All of the sample compile just fine (once the macos framework has been fixed to version 10.13, instead of version 10.8).
How do I know which verison of XCode the SDK is targeting? It's a bit hard to get hold of an older version of XCode, so if the current version doesn't work with the SDK, things seem a bit bleak.
Copy link to clipboard
Copied
Don't try to get your own code to compile until you have the starter project compiled and working. Is it working? You probably should not update the MacOS framework, though, not unless it is working well and you want to experiment. Just install the old SDK.
Which version of the SDK do you have? What is the difficulty in getting hold of older versions of XCode?
Copy link to clipboard
Copied
I'm using the latest version, 9.2. I'm pretty new to mac development and find it to be a not so pleasant experience, mostly because of lacking examples from Apple.
Are you saying that I need to have 10.8 (or just the 10.8 SDK) installed to use the adobe SDK?
Copy link to clipboard
Copied
(And you should also use the specific OS version for which the SDK was designed. I use Parallels to do that).
Copy link to clipboard
Copied
9.2? The SDK for Acrobat 9? That is many years obsolete.
I’m saying that you should not make difficulties when starting with plugins. It’s hard enough without also trying to solve problems of system and IDE compatibility with a development environment you don’t yet understand. Once you have a basic plugin going you can try to change things to suit you better.
10.8 may not be needed: that’s just the okdest targeted system, for which you load the SDK in the usual way.
Copy link to clipboard
Copied
No, XCode 9.2. The Adobe SDK, I downloaded a few days ago, so I assume it's the latest. The link to the documentation was fixed yesterday -- I haven't checked if that included and updated SDK, but I doubt it has.
Copy link to clipboard
Copied
It can be hard to find the right XCode, and I’m still using the first DC SDK. Let’s hear from someone who has a compatible release. But first, did you download the relevant MacOS SDK and reset to 10.8?
Copy link to clipboard
Copied
I downloaded the SDK and reset the target SDK (macOS) to 10.13. I've got most things working now (I think), except the final stage of the build, where a script is called to copy the result (I think) to where Adobe finds plugins.
Copy link to clipboard
Copied
That part I ignore... since I need something to deploy it on the end user's system anyway. That at least you can do manually, once you've worked out where to put plug-ins. It changed at DC, formerly it was inside the app bundle, now it's a folder under Application Support somewhere. The script may tell you. It is different for the continuous and classic version.