Copy link to clipboard
Copied
I am working with the BasicPlugin sample. I complied it in visual studio to a .dll file which I then changed the extension to a .api and added to the plu_ins folder. However, when I open acrobat xi pro BasicPlugIn does not appear as a Third party Plug-in and it does not appear in the Adobe Plug-Ins. Where should the modified Acrobat SDK plug-ins show up? In other words, how do I access my modified BasicPlugIn?
Yeah – you should use the project provided as it handles all that stuff as well as getting you a properly build .api out.
Copy link to clipboard
Copied
It should have built a .api, if it build a DLL, then I suspect something didn’t work as expected.
What version of Visual Stuidio are you using? With what version of the SDK?
Copy link to clipboard
Copied
I'm using visual studio 2012. I didn't see and option to build and .api
Copy link to clipboard
Copied
I'm using visual studio 2012. I didn't see and option to compile to a .api file.
Copy link to clipboard
Copied
Did you simply load and build the existing project file from the SDK?
Copy link to clipboard
Copied
When I initially tried to compile I receive the following errors
1>..\..\..\..\..\Desktop\BasicPlugin\sources\BasicPlugin.cpp(77): error C3861: 'sprintf': identifier not found
1>..\..\..\..\..\Desktop\BasicPlugin\sources\BasicPlugin.cpp(84): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h(115) : see declaration of 'strcat'
1>..\..\..\..\..\Desktop\BasicPlugin\sources\BasicPlugin.cpp(90): error C3861: 'sprintf': identifier not found
1>CL : warning : Using older Acrobat SDK. Define ACRO_SDK_LEVEL to 0x00090000
1>BasicPlugin.obj : error LNK2001: unresolved external symbol _gPDModelHFT
1>BasicPlugin.obj : error LNK2001: unresolved external symbol _gAcroViewHFT
1>BasicPlugin.obj : error LNK2001: unresolved external symbol _gExtensionID
1>BasicPlugin.obj : error LNK2001: unresolved external symbol _gCoreHFT
1>BasicPluginInit.obj : error LNK2001: unresolved external symbol _RestorePlugInFrame
I added the the following lines to fix these errors:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
HFT gCoreHFT;
ExtensionID gExtensionID;
HFT gAcroViewHFT;
HFT gPDModelHFT;
ACCB1 void ACCB2 RestorePlugInFrame(void* environ)
{
}
Along with these header file:
#include "CorCalls.h"
#include "PIMain.h"
#include "PICommon.h"
#include "AVCalls.h"
#include "PDCalls.h"
#include "PIMain.h"
Copy link to clipboard
Copied
I also got this error:
1> BasicPlugin.cpp
1>C:\Users\lwardell\Desktop\API\Environ.h(37): fatal error C1189: #error : You must define the PLATFORM macro
1> BasicPluginInit.cpp
1>C:\Users\lwardell\Desktop\API\Environ.h(37): fatal error C1189: #error : You must define the PLATFORM macro
which was fixed by adding WIN_ENV to the Preprocessor Definitions in visual studio
Copy link to clipboard
Copied
All of that should have been part of the VC project to begin with. Did you use the existing project or create your own?
Copy link to clipboard
Copied
I created a new project in visual studio and then I attached the existing BasicPlugin.cpp and BasicPluginInit.cpp
Copy link to clipboard
Copied
Yeah – you should use the project provided as it handles all that stuff as well as getting you a properly build .api out.
Copy link to clipboard
Copied
On no account try to make your own projects until you know your way around plugins pretty well. There is so much to go wrong: at compile time, link time, libraries, exports, loading, naming, initialising... eventually you may be able to make new projects but to be honest I think in over a decade I never have.
Copy link to clipboard
Copied
Thanks I tested it out it's working fine now. No errors.
Copy link to clipboard
Copied
I want to second TSN's advice to not even try to come up with your own project from scratch. When I first got into plug-in programming (back in the days of Acrobat 4), I painstakingly reverse engineered the project setup and created my own wizard to spit out Acrobat plug-in skeletons for a large project that required a large number of plug-ins. I've since abandoned that approach and now just use the starter plug-in and change the few things that make a plug-in unique. Much easier and faster and most importantly, less likely to mess things up. This approach requires that you edit project files, but you are only searching and replacing the plug-in name or file names, and the rest can stay as it is.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now