Quantcast
Channel: Adobe Community : Popular Discussions - InDesign SDK
Viewing all 78596 articles
Browse latest View live

Filename is empty after ReLink

$
0
0

Hello,

 

I have the following code:

 

Utils<Facade::ILinkFacade> linkFacade;

 

            K2::UIFlags uiFlags = K2::UIFlags::kSuppressUI;

 

            ErrorCode relinkResult = linkFacade->RelinkLink(linkRef,

                                                            newLinkURI,

                                                            uiFlags,

                                                            linkUID);

 

InterfacePtr<constILink> theLink(database, linkUID, UseDefaultIID());

InterfacePtr<constILinkResource> theLinkResource(database, linkResourceUID, UseDefaultIID());

 

ISession *mySession = GetExecutionContextSession();

InterfacePtr<IK2ServiceRegistry> serviceR(mySession, UseDefaultIID());

IK2ServiceProvider *nameSvc = serviceR->QueryServiceProviderByClassID(kLinkInfoService,

                                                                      kLinkInfoNameProviderBoss);

InterfacePtr<constIK2ServiceProvider> nameProvider(nameSvc);

InterfacePtr<ILinkInfoProvider> nameInfoService(nameProvider, UseDefaultIID());

 

PMString linkImageFileName = nameInfoService->GetUpdatedInfoForLink(theLink,

                                                                    theLinkResource,

                                                                    true); // This now gives an empty string.

 

But after a relink, linkImageFileName is an empty string. How is that possible and what do I need to do in order to read the filename AFTER a relink?

I think it may be due to the fact that the document has not been saved and that the updated info is not in the document database?

 

 

Thanks in advance.. Regards, Jan


Setting bleedbox on document deletes all elements

$
0
0

Hi All,

The following code works fine for an empty document:

 

...

    UIDRef docRef = ::GetUIDRef(doc);

    float h = mm2pt(getHeight(refnum) / 1000.);

    float w = mm2pt(getWidth(refnum) / 1000.);

 

    /* bleed values in points: */

    PMRect bleedBox;

    bleedBox.Left(mm2pt(bleedLeft / 1000.f));

    bleedBox.Top(mm2pt(bleedTop / 1000.f));

    bleedBox.Right(mm2pt(bleedRight / 1000.f));

    bleedBox.Bottom(mm2pt(bleedBottom / 1000.f));

 

    // Create a SetPageSizeCmd 

    ///InterfacePtr<ICommand> pageCmd(CmdUtils::CreateCommand(kSetPageSizeCmdBoss)); <-- This interface doesn't work

    InterfacePtr<ICommand> pageCmd(CmdUtils::CreateCommand(kSetPageSetupPrefsCmdBoss));     <-- This was recommended by community member

 

    // Get an IDocSetupCmdData  for the SetPageSizeCmd:

    InterfacePtr<IDocSetupCmdData> pageData(pageCmd, IID_IDOCSETUPCMDDATA);

   

    pageData->SetDocSetupCmdData(docRef, PMPageSize(w, h), 1, 1, w > h, kLeftToRightBinding, kFalse);

    pageData->SetUseUniformBleed(false);

    pageData->SetBleedBox(bleedBox);

    CmdUtils::ProcessCommand(pageCmd);

 

But if if I have a document opened, all elements are blown away by executing this commend. Size and bleeds are fine.

I thought I only have to setup a command and command data, but something is missing. I only want to change the bleeds, nothing else.

What do I have to change?


Thanks for all your hints!


kb_alfa

Update UI when IdleTask is done

$
0
0

Hello,

 

I would like to automatically update the UI of my plugin after an IdleTask is done.

How should I do that?

 

UPDATE:

I am trying to do the following:

I have a button that is disabled and I start an IdleTask and when it is finished the button should be enabled.

Does it make sense to use the IID_ISTARTUPSHUTDOWN interface to start a separate dedicated UI IdleTask when the plugin starts

that updates the UI periodically?

Or is there some other construct I can use... I also tried to use IEventWatcher to no avail.

 

 

Regards,

Jan

Relink within IdleTask

$
0
0

Hello,

 

My plugin crashes when I try to use

 

Utils<Facade::ILinkFacade> linkFacade;

 

  ErrorCode relinkResult = linkFacade->RelinkLink(linkRef,

  newLinkURI,

  uiFlags,

  linkUID);

 

From within an IdleTask.

 

Is it possible to relink a page item from within an IdleTask and what do I need to do in order to make it work?

 

Thanks in advance.

 

 

Regards,

Jan

[CS3 Mac]: Loading of plugin fails?

$
0
0
Hello!

I have a plugin.

The build process with XCode succeeds.

But when the plugin is loaded in Adobe InDesign CS3 Debug there are coming two error messages:
"CFBundleLoadExecutable failed for plugin ..."
"GetPlugIn returned nil for plugin ..."

My system:
Mac OS X 10.5.4
XCode 3.0
Adobe InDesign Debug Version 5.0.3

My question:
How can I find out more why the loading of the plugin fails?

Thanks,
Alois Blaimer

Convert Indesign CS2 plugin to Xcode 3?

$
0
0
Hi all,

I want to compile a sample plugin project given in the InDesign CS2 SDK using xcode 3.

How can i go about this?

Any documentation about porting InDesign CS2 plugin code to Xcode 3?

I want to do this since im not able to get CW 9.3 to develop a CS2 plugin.

Thanks
myriaz

How to set the default object style ?

$
0
0
Hi,<br /><br />I want to set the default object style and tried to use the kApplyObjectStyleCmdBoss, but when doing this InDesign crashes.<br />So I think there's something wrong with the parameter I pass to the command.<br />Here is my code:<br /><br />InterfacePtr<IDocument> document(documentUIDRef, UseDefaultIID());<br />InterfacePtr<IWorkspace> workspace(document->GetDocWorkSpace(), UseDefaultIID());<br />InterfacePtr<IObjectStylesSuite> objectStylesSuite(workspace, UseDefaultIID());<br />InterfacePtr<ICommand> applyObjectStyleCmd(CmdUtils::CreateCommand(kApplyObjectStyleCmdBoss));<br />InterfacePtr<IStringData> applyObjectStyleCmdStringData (applyObjectStyleCmd, UseDefaultIID());<br />applyObjectStyleCmdStringData->Set(objectStylesSuite->GetNameOfNthStyle(0));<br />CmdUtils::ProcessCommand(applyObjectStyleCmd);<br /><br />Any ideas how to solve this problem ?<br />Thanks, Daniel

[CS3] How to clear graphic overrides?

$
0
0

Could anybody tell me how to clear spline item graphic overrides as it done by "Clear overrides" button in "Object Styles" tab?

I've tried different approaches but now one of them works.

 

Thanks in advance.


Drag and drop the text and image

$
0
0

Hi,

 

I need help in drag and drop text and image.

 

I am able to drag and drop the text and image in doc but  i want to drag the text in text frame and image in image frame only.

 

 

For this how to get textframe id or is there any other way to do this. Pls help me if anyone know how to do this one.

 

Thanks

Arun

PMPoint to Text Index conversion

$
0
0

Hi All,

 

 

Can anyone guide me for the following,

- I am having a PMPoint object in Pasteboard coordinate space and this lies within in a text box.

- I want to calculate corresponding text index to this PMPoint.

 

 

I didn't find any APIs in InDesign which takes a PMPoint and provide its corresponding text index in a text frame even in waxline and waxrun interfaces.

 

 

Some Info:

1) Application: Adobe InDesign CS4

2) Machine:  MAC OS X

 

 

 

Thanks,

Vinod

InDesign Tool: How I could enable/disable a tool

$
0
0

Hi All,

 

I am looking into a way usnig which I can enable/disable a tool.

 

e.g. On openning a plugin Idialog  want to disable "Text type tool" and enable it when plugin dialog is closed.

 

Do we have control on these eanbling/disabling of InDesign tool.

 

Regards,

Alam

importing tables with linked cell data from excel to indesign

$
0
0

Hey,

 

I'm designing a catalog and have been linking the tables in InDesign from a spreadsheet in excel. In my spreadsheet, I am linking cells from a master sheet to another sheet so that I when I update the information on one sheet, it will update throughout the spreadsheet.

 

Now that I have the linked cells set up in my spreadsheet, I've inputed the tables into InDesign but: the table cells in InDesign containing linked cells from within the spreadsheet do not appear.

 

I've gone through all the import table options in InDesign and cannot find a way to make it work.

 

Does anyone have an answer or input?

 

Thanks,

KT

Newbie - Boss classes and interfaces

$
0
0

I'm currently going through Kris Coppieters' "Adobe InDesign CS3/CS4 SDK Programming Getting Started" book and I'm stuck at one of the exercise (11.9) It asks me to create a new boss 'kIDSDKTrainerBoss' which aggregates 2 interfaces 'ISDKTrainerName' and 'ISDKTrainerBlob'.

 

Now here is what I added in my .fr file:

Class
    {
        kIDSDKTrainerBoss,
          kDialogBoss,
        {
            IID_ISDKTRAINERNAME, kISDKTrainerNameImpl,
            IID_ISDKTRAINERBLOB, kISDKTrainerBlobImpl,
        }
    },

 

  1. First of all I'm not quite sure about the interface IDs. Are IID_ISDKTRAINERNAME and IID_ISDKTRAINERBLOB suitable?
  2. What are the files that I need to create? I guess there will be a ISDKTrainerName.cpp and ISDKTrainerBlob.cpp but apart from those?
  3. How to know which parent Boss ID to use? Here I've put kDialogBoss, but that was just to mimic the other bosses in the .fr file.
  4. Is there somewhere where I can get the source code with the solution, it's not in the zip file provided along with the book?

 

Thanks in advance for your help
-- Bastien

CS5.5: How do you derive the size of the pasteboard given an ISpread?

$
0
0

Basically what I'm doing is programmatically creating a frame on a document and placing the frame anywhere.

This works as long as I create the frame somewhere on the pasteboard.

(I'm defining the pasteboard as that white area on which the pages are positioned.)

 

If I place a frame anywhere fully on the pasteboard then things are all okay.

Even if the new frame slightly overlaps the pasteboard then things are all okay.

However, if I create the new frame so that it is entirely not on the pasteboard then it will crash InDesign.

 

What I need is some way to determine the rectangular bounds of the pasteboard.

This would mean that I could then push the new frames back onto the pasteboard to stop the crash.

However I can't figure out how to get the pasteboard size.

 

Any ideas on how to get a PMRect of the pasteboard bounds when given a ISpread?

How to apply persistence through command?

$
0
0

In indesign6 sdk there is en example WaterFishPrice , my task is to persist the value in text item(text item obtaining value from pallete) .I have to apply  persistence through commands.Pls help in completing the task?


Changing style of a text using Drag and Drop

$
0
0

Hi,

 

I am developing a plugin which consists of a panel which is having styles properities. Uses should be able to change the style of a text using drag and dropping the styles from the panel . I want know how we can access the drop target. as an example if we are changing the style of a text when dropping the dragged content, is there any way we can get the reference of that text so that I can change the properties of that text using drag and drop feature?

 

Thank you.

RelinkLink and AI files causes crashes

$
0
0

Hi everyone,

 

I'm currently trying to relink a link of a picture frame containing an Adobe Illustrator picture. For any reason, it crashes from times to times. More generally, this crashes sometimes with vector graphics, and not with matricial graphics. Some pictures can crash the first time, and not crash the next time I try to relink it.

 

I use the ILinkFacade to perform this operation, with method RelinkLink. I tried using CanRelinkLink for protection purpose. It crashes in the RelinkLink method :

 

IDataBase *db = parentGraphicFrameRef.GetDataBase();

URI newURI; Utils<IURIUtils>()->IDFileToURI(this->fileToImport, newURI);

Utils<Facade::ILinkFacade> iFacade;

UID linkUID = Utils<ILinkUtils>()->FindLink(oldImageItemRef);

UID newLinkUID = kInvalidUID;

UIDReflinkRef (db, linkUID);

if (iFacade->CanRelinkLink(linkRef)){

    localError = iFacade->RelinkLink(linkRef, newURI, K2::kSuppressUI, newLinkUID);

}

How to auto-refresh the panel in panel tree view plugin .....

$
0
0

Hi Team,

I am modifying the paneltreeview plugin.... Currently I need an auto-refresh of the panel .... please suggest how to do the same... Thanks in advance....

Drag n Drop selected Text from Safari, chrome not working on indesign CC

$
0
0

In CS6 If we drag drop any selected text from any app on layout it work but in indesign cc it is working only with some app like TextEdit, notes etc. I knew that very few people have such use case but same is also not working from one of my cocoa app.

while  debugging if i drop content from TextEdit and Notes app on some sample app I found that TextEdit & Notes App registered for this Extra Pasteboard type "com.adobe.indesign-import-ustl" and "com.adobe.indesign-import-styl" where as chrome and safari are not. similarly my app is registered only for "NSPasteboardTypeString" type. Is this is the limitation or bug of indesign?

Drag'n'Drop working in CS, not in CC

$
0
0

Hi everybody,

 

I have a Flex panel and a native plugin in InDesign. From the flex panel, I initiate a drag, that I wish to drop in InDesign. In my plugin, I have a CDragDropTargetFlavorHelper that works fine up to CS6 to handle the drop initiated by the Flex panel.

 

I have just tried the same operation in InDesign CC 2014 (don't know on CC), but this does not work.

 

In my Flex panel, I set HTML and URL flavours on the drag source. In my native plugin, there is no reaction to those flavours. CouldAcceptTypes() method is even not called. But if I add for example a text flavour in my flex panel, I think another helper consumes my drag, and my plugin does not receive it.

 

Is there any change between CS6 and CC2014 in drop process in native plugins? Or is it in Flex that it has changed?

 

How can I handle this? Should I create a custom flavour shared between my flex panel and my native plugin? If yes, how can I do this in my native plugin?

 

Thanks in advance.

 

Rémi

 

EDIT : In my Flex panel, I use flavours ClipboardFormats.URL_FORMAT and ClipboardFormats.HTML_FORMAT. I don't find any matching flavour in native plugin SDK. Historically, I have seen I use something really strange (I don't know where it comes from): PMFlavor(1213484364).

 

Message was edited by: Rémi Doolaeghe

Viewing all 78596 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>