Hi,
I need to write a plugin to display missing plugin and plugin used in a document using IContentMgr.
Please help proceed further.....
Hi,
I need to write a plugin to display missing plugin and plugin used in a document using IContentMgr.
Please help proceed further.....
Hello All,
I am trying to create an inline image frame within a text frame. and then I am trying to position the inline Image frame with Aboveline option.
But it doesn't work. I am able to sucessfully create the inline frame with help available in Snippet project. But when I try to set the position it fails not sure why. This is in InDesign CS6.
I am trying to do the following:
InterfacePtr<ITextModel> textModel(storyUIDRef, UseDefaultIID());
if(!textModel)
{
break;
}
InterfacePtr<IGeometry> pageItemGeometry(frameUIDRef, UseDefaultIID());
if (pageItemGeometry == nil) {
break;
}
// Insert character in text flow to anchor the inline.
boost::shared_ptr<WideString> insertMe(new WideString);
insertMe->Append(kTextChar_Inline);
InterfacePtr<ITextModelCmds> textModelCmds(textModel, UseDefaultIID());
InterfacePtr<ICommand> insertTextCmd(textModelCmds->InsertCmd(whereTextIndex, insertMe));
status = CmdUtils::ProcessCommand(insertTextCmd);
if(status != kSuccess) {
break;
}
// Change the page item into an inline.
InterfacePtr<ICommand> changeILGCmd(CmdUtils::CreateCommand(kChangeILGCmdBoss));
if (changeILGCmd == nil) {
break;
}
InterfacePtr<IRangeData> rangeData(changeILGCmd, UseDefaultIID());
if (rangeData == nil) {
break;
}
rangeData->Set(whereTextIndex, whereTextIndex);
InterfacePtr<IUIDData> ilgUIDData(changeILGCmd, UseDefaultIID());
if (ilgUIDData == nil) {
break;
}
ilgUIDData->Set(frameUIDRef);
changeILGCmd->SetItemList(UIDList(textModel));
status = CmdUtils::ProcessCommand(changeILGCmd);
InterfacePtr<ITextModel> textModel(storyUIDRef, UseDefaultIID());
if(!textModel) {
break;
}
InterfacePtr<IGeometry> pageItemGeometry(frameUIDRef, UseDefaultIID());
if (pageItemGeometry == nil) {
break;
}
// Insert character in text flow to anchor the inline.
boost::shared_ptr<WideString> insertMe(new WideString);
insertMe->Append(kTextChar_Inline);
InterfacePtr<ITextModelCmds> textModelCmds(textModel, UseDefaultIID());
InterfacePtr<ICommand> insertTextCmd(textModelCmds->InsertCmd(whereTextIndex, insertMe));
status = CmdUtils::ProcessCommand(insertTextCmd);
if(status != kSuccess) {
break;
}
// Change the page item into an inline.
InterfacePtr<ICommand> changeILGCmd(CmdUtils::CreateCommand(kChangeILGCmdBoss));
if (changeILGCmd == nil) {
break;
}
InterfacePtr<IRangeData> rangeData(changeILGCmd, UseDefaultIID());
if (rangeData == nil) {
break;
}
rangeData->Set(whereTextIndex, whereTextIndex);
InterfacePtr<IUIDData> ilgUIDData(changeILGCmd, UseDefaultIID());
if (ilgUIDData == nil) {
break;
}
ilgUIDData->Set(frameUIDRef);
changeILGCmd->SetItemList(UIDList(textModel));
status = CmdUtils::ProcessCommand(changeILGCmd);
//this created an Inline frame
UIDList newList;
newList = changeILGCmd->GetItemListReference();
// trying to set the position through newList
In the snippet its with active selection which i don't have here. Thus am trying to use the newList. I also tried IAnchoredObjectData command with the newList. Even that is not successful.
Is there something wrong what i am doing.
If someone has already tried this before please do let me know.
Thanks all in Advance.
Regards
Farzana.
Hi,
Currently I'm using StreamUtil::CreatePointerStreamWrite in conjunction with the SnapshotUtils Export-function to fill a buffer of char* with encoded image data (TIFF) for further processing in memory. It works but I need some guidance to improve performance. A couple of questions:
1) Is there a way to directly address the raw, unencoded image data stored in some kind of multi-array representation like WxHxColorCh?
Maybe with the help of an own 'format class?
2) How can you determine the number of chars / bytes written to the buffer by ExportImageToTIFF() for example?
3) Images differ very much in size. Is there a clever way to pre-allocate the char* buffer?
3) I implemented SnapshotUtils (like in one of the sdk sample) not SnapshotUtilsEx because the latter doesn't honor the overprinting flag during testing it seems (file export in low quality). SnapshotUtils (without Ex) isn't mentioned in the sdk's docu. Reason? Obsolete?
I appreciate any advice to get things into the right direction. Thanks.
If the text file drag and drop on the frame in Document, text is put the frame.
At that time, can I know the frames uid or story of uid which is inside?
(I didn't drag and drop where frame is not exist)
Hi!
We are producer and vendor of an InDesign plug-in that is available from CS6 to CC2015. We would like to build an installer for the plug-ins that installs it on Windows machines. (We already have a Mac version (and have been using Extension Manager for both platforms in the past).)
Does somebody have example code on how to do detect the InDesign version on the customer system? We are not yet fixed on an installer platform - so anything (e.g. WIX, NSIS, Inno Setup) would be welcome.
Thanks!
Etienne
This is function get attribute of TextRange:
template <class TextAttrType, class _Val_Type>
ErrorCode GetTextScriptProvider::GetTextAttribute(const InDesign::TextRange& textRange,
const ClassID& attrClassID,
_Val_Type& value)
{
// Assume failure.
value=0;
ErrorCode status = kFailure;
do
{
// Check if the text range is valid.
if (textRange.IsValid() == kFalse)
{
//SNIPLOG("textRange is invalid - you must have some text selected first.");
break;
}
// Query the text model and get the range data,
InterfacePtr<ITextModel> textModel(textRange.QueryModel());
RangeData rangeData = textRange.GetRange();
// Query the compose scanner to access text attributes
InterfacePtr<IComposeScanner> composeScanner(textModel, UseDefaultIID());
if (composeScanner == nil)
{
ASSERT(composeScanner); break;
}
// Query attribute report interface
int32 attrLen = 0;
InterfacePtr<const IAttrReport> attrReport(composeScanner->QueryAttributeAt(rangeData, attrClassID, &attrLen));
if (attrReport == nil)
{
//SNIPLOG("Could not find text attribute with Class ID 0x%X on the selected text!", attrClassID.Get());
break;
}
// Query the attribute interface
InterfacePtr<TextAttrType> attr(attrReport, TextAttrType::kDefaultIID);
if (attr == nil)
{
//SNIPLOG("attr is nil! (Class ID 0x%X)", attrClassID.Get());
break;
}
// Get the attribute value.
const _Val_Type tempValue = attr->Get();
value = tempValue;
status = kSuccess;
} while (false);
return status;
}
This is my code get underline type, but it no working:
int16 underlineType;
res=GetTextAttribute<ITextAttrInt16, ITextAttrInt16::ValueType>(oCharRange, kTextAttrCharUnderlineTypeBoss,underlineType);
How get Underline Type of Character?
I am working on Xcode 8.2.1 @, to build a indesign plugin .
Can anyone suggest which library i need to link , for below SnapshotUtilsEx.
I am calling SnapshotUtilsEX::Draw() method in HTTPHelper.cpp file.
Below is the linker error trace which i get , when I try to build my project.
Undefined symbols for architecture x86_64:
"SnapshotUtilsEx::Draw(int, unsigned int, PMReal const&, unsigned int, SnapshotUtils::Transparencies, IdleTimer*, std::__1::map<IDType<ClassID_tag>, PMReal, std::__1::less<IDType<ClassID_tag> >, std::__1::allocator<std::__1::pair<IDType<ClassID_tag> const, PMReal> > >*, unsigned int)", referenced from:
HTTPHelper::ExportLayout(IDocument*, PMString, PMString) in HTTPHelper.o
Below is the code snippet where i am making a call to the method.
SnapshotUtilsEx snapshot(pageUIDRef, 1.0, 1.0, desiredRes, 16.0, bleedAmount, SnapshotUtilsEx::kCsRGB, kFalse);
int errorCode = snapshot.Draw(IShape::kNoFlags, quality == SnapshotUtils::kSSJPEGGreatQuality&& desiredRes > 16.0 ? kTrue : kFalse, 1.0, desiredRes > 16.0 ? kTrue : kFalse, desiredRes > 16.0 ? SnapshotUtils::kXPHigh : SnapshotUtils::kXPLow);
Hello,
I can iterate over an IPageList and I can iterate over the links in a ILinkManager.
But how can i know which link is on which page (page number)?
I'm not familiar with the UID and UIDRef system from InDesign.
Is there an interface overview somewhere to know which interface works with which together?
Thanks in advance
Regards
I have the UIDRef of the Rectangle which is in selection. That rectangle is basically in Cell, and when user selects that Rectangle or the cell, I need UIDRef of container text Frame and iTableModel. When i queryParent() the rectangle the Object that i get is invalid.
Please refer the image placed above. Kindly help.
@dirk
Hi All,
I am trying to get the four coordinates(PMPoint) of a rotated image frame.
InterfacePtr<IGeometry> pGeometry (itemList.GetRef(iCOUNT) , IID_IGEOMETRY);
PMMatrix matrix = ::InnerToParentMatrix(pGeometry);
PMRect rPageItemBoxRect = pGeometry->GetStrokeBoundingBox(matrix);
When I use LeftTop() on rPageItemBoxRect, I was expecting to get the true X & Y values at that point as are visible on the Info palette.
The LeftTop() .X() is ok but the LeftTop() .Y() is not the Y value at that point. It is the topmost Y of the frame which is actually the Y value for the RightTop corner.
Similarly all the values I am getting are wrong.
The X() gives the leftmost value of the frame for both LeftTop() and LeftBottom() , when they are different for the rotated frame.
And the X() gives the rightmost value for the frame for both RightTop() and RighBottom(),
Y() gives the topmost value for the frame for both LeftTop() and RightTop() and so on.
How can I get the actual box coordinates and not the bounding box coordinates, so that I get the correct X,Y values for all the four corners of my rotated frame as I can see them on the Info palette.
Regards,
Jasmine Shaikh
I have a plugin which supports InDesign CS 5.5 through to CC 2017 on Mac and Windows.
Since adding support for CC 2015, I submit the zxp file to the add-ons website for installation.
I'm trying to add support for CC 2017 and running into problems at submission time.
When I upload the zxp and it has undergone analysis, the listed compatibility only goes up to CC 2015, not 2017 (on both windows and mac).
Clicking on Compatibility "Important Info" however shows support up to version 12.9, which is CC 2017.
When submitted, it comes back as rejected, saying it won't install to CC 2017.
The .InDesignPlugin and .pln files packaged into the zxp work fine with CC 2017 on all the mac and windows machines I've tried.
My mxi file lists 12.9 as the maximum version and copies the 2017 files to the application for 12.0 to 12.9.
I've tried removing the maxversion specification in the mxi to make it open ended and the same thing happens.
I don't know of a way to try the installation process my end as ExtensionManager only supports up to CC 2014.
I'm at a loss as to why 2017 is not being recognised. Can anyone help?
I want to my plugin to create a simple document as soon as My Plugin is loaded in Indesign. I have derived my class IStartupShutdownService so that it's called in startup.
But this is failing at line 23 below.
What else do I need to include in my .fr file?
class LTestStartupShutdownServiceImpl : public CPMUnknown<IStartupShutdownService> { public: LTestStartupShutdownServiceImpl(IPMUnknown* boss); virtual ~LTestStartupShutdownServiceImpl(); virtual void Startup(); virtual void Shutdown(); }; CREATE_PMINTERFACE(LTestStartupShutdownServiceImpl, kLTestStartupShutdownServiceImpl) LTestStartupShutdownServiceImpl::LTestStartupShutdownServiceImpl(IPMUnknown *boss):CPMUnknown<IStartupShutdownService>(boss) { do { const PMReal width=612, height=792; const int32 numPages=5, numPagesPerSpread=1; // Create the command. InterfacePtr<ICommand> newDocCmd(Utils<IDocumentCommands>()->CreateNewCommand()); //<-----this is coming null and failing ASSERT(newDocCmd); if (newDocCmd == nil) break; // Set the command's parameterised data. InterfacePtr<INewDocCmdData> newDocCmdData(newDocCmd, UseDefaultIID()); ASSERT(newDocCmdData); if (newDocCmdData == nil) break; newDocCmdData->SetCreateBasicDocument(kFalse); // Override the following defaults. PMPageSize pageSize( width, height); newDocCmdData->SetNewDocumentPageSize(pageSize); bool16 bWide = kTrue; // landscape orientation. newDocCmdData->SetWideOrientation(bWide); // Size margin proportional to document width and height. PMReal horMargin = width / 20; PMReal verMargin = height / 20; newDocCmdData->SetMargins(horMargin, verMargin, horMargin, verMargin); newDocCmdData->SetNumPages(numPages); newDocCmdData->SetPagesPerSpread(numPagesPerSpread); // Create the new document. CmdUtils::ProcessCommand(newDocCmd); } while (false); } LTestStartupShutdownServiceImpl::~LTestStartupShutdownServiceImpl() {} void LTestStartupShutdownServiceImpl::Startup() {} void LTestStartupShutdownServiceImpl::Shutdown() {}
Below is the .fr file:
/* * Boss class definitions. */ resource ClassDescriptionTable(kSDKDefClassDescriptionTableResourceID) {{{ Class { kLTestStartupShutdownServiceBoss, kInvalidClass, { // Implementation of IStartupShutdownService IID_ISTARTUPSHUTDOWN, kLTestStartupShutdownServiceImpl, // Implementation to IK2ServiceProvider to identify the service type as startup-shutdown IID_IK2SERVICEPROVIDER, kLTestStartupShutdownServiceImpl, } }; }}};
Hi, I am trying to build one of the sample plugin WriteFishPrice from the SDK on mac System
I am using Xcode 5.0.2 as per the documentation, but I am encountering the below errors during compilation.
In UnicodeSavvyString.h
template <class FwdIterator> inline void UnicodeSavvyString::assign_impl(FwdIterator b, FwdIterator e, size_type nCodePoints, std::forward_iterator_tag) { const difference_type nCodeValues = std::distance(b, e); ASSERT(nCodeValues >= 0); // Make room for the chars code_value* buffer = GetBufferForWriting(nCodeValues); // <----Implicit conversion loses integer precision long to int // Copy them into the buffer std::copy(b, e, buffer); // Ensure terminating null buffer[nCodeValues] = code_value(); fUTF16BufferLength = nCodeValues; // <----Implicit conversion loses integer precision long to int // Calculate how many code points we will have at the end if (nCodePoints == 0 && nCodeValues) { fNumChars = CountCharsUtil(buffer, nCodeValues); // <----Implicit conversion loses integer precision long to int } else { ASSERT((size_type)CountCharsUtil(buffer, nCodeValues) == nCodePoints); fNumChars = nCodePoints; } }
And similar errors are coming in WideString.h.
Can some one tell me what is wrong with the new SDK? Or if I need to make some changes in these files which surely is not advisable.