place PDF into inDesign using SDK plugin
how to place multiple or single pdf to adoe inDesign via C++ SDK plugin. i cannot find the necssary API calls or documentation to achive this.
how to place multiple or single pdf to adoe inDesign via C++ SDK plugin. i cannot find the necssary API calls or documentation to achive this.
I searched the SDK but did not find any direct way to do this with single command but you can do this in two steps -
1. Set the PDF Preferences indicating which page number to import, crop settings etc.
2. Load the PDF file and place it.
Refer the below snippets -
// PDF Preferences -
InterfacePtr<ICommand> setPDFPlacePrefsCmd(CmdUtils::CreateCommand(kSetPDFPlacePrefsCmdBoss));
InterfacePtr<IPDFPlacePrefs> iPDFPlacePrefs(setPDFPlacePrefsCmd, IID_IPDFPLACEPREFS);
// SetPage takes 1 based index
iPDFPlacePrefs->SetPage(i + 1); // which page of pdf to import.
iPDFPlacePrefs->SetTransparentBackground(kFalse);
iPDFPlacePrefs->SetCropTo(IPDFPlacePrefs::kCropToMedia); // crop settings
CmdUtils::ProcessCommand(setPDFPlacePrefsCmd);
// place file in frame
Use the following from SDK -
SDKLayoutHelper::PlaceFileInFrame
I tested and I was able to place the PDF in the frame.
Other Solution could be - Load the PlaceGun which will load all the PDF Pages and then iterate the placegun and place the pdf pages.
- Rahul Rastogi
Adobe InDesign C++ Plugin Architect.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.