• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Export Document to PNG file. Change default export settings.

Explorer ,
Jan 19, 2013 Jan 19, 2013

Copy link to clipboard

Copied

Hi All,

In my plugin I need to export active document to png file with specific options. And sometimes I need to export definite pages from the document, but not all.

In standard UI of InDesign there are several basic steps of export:

1."File"->"Export";

2. Choose the location and filename to export to;

3. Customize export options.

PNGExportDlg.png

In my plugin I need to have the possibility to set options from 2 and 3 steps.

I have found out that there are some bosses, which deal with PNG:

kPNGErrorStringServiceBoss

kPNGExportCommandBoss

kPNGExportPrefsScriptProviderBoss

kPNGExportProviderBoss

kPNGExportSetPrefsCommandBoss

kPNGExportUIDialogBoss

kPNGFilterConversionBoss

kPNGIconButtonWidgetBoss

kPNGImageReadFormatBoss

kPNGImageWriteFormatBoss

kPNGPrefsDialogBoss

Also, there are some interfaces and widget id's in the following headers "PNGFilterUIID.h", "PNGPrefsUIID.h", "PNGFilterID.h", which deal with png export process.

One of the ways to solve my problem is to create png export dialog (maybe IDialogMgr::CreateNewDialog), iterate over all widgets and set necessary values, but I don't know how to create this ExportDialog.

Any ideas how to solve this are of great value.

Thanks in advance.

TOPICS
SDK

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Mar 01, 2013 Mar 01, 2013

The sollution is the following:

1. Make an AddIn to kDocBoss with new interface e.x. IExportToPNG

2. In implementation of IExportToPNG, use SnapshotUtilsEx.

P.S.

The right order of using SnapshotUtilsEx is:

1. Use constructor of SnapshotUtilsEx(...)

2. SnapshotUtilsEx::Draw(...)

3.  SnapshotUtilsEx::ExportImageToPNG(...)

Regards!

Votes

Translate

Translate
Guide ,
Jan 21, 2013 Jan 21, 2013

Copy link to clipboard

Copied

Have a look at the Basic Dialog sample.

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 21, 2013 Jan 21, 2013

Copy link to clipboard

Copied

I have already tried this method from the SDK example:

    // Load the plug-in's resource.

        PMLocaleId nLocale = LocaleSetting::GetLocale();

        RsrcSpec dialogSpec

        (

            nLocale,                    // Locale index from PMLocaleIDs.h.

            kBscDlgPluginID,            // Our Plug-in ID from BasicDialogID.h.

            kViewRsrcType,                // This is the kViewRsrcType.

            kSDKDefDialogResourceID,    // Resource ID for our dialog.

            kTrue                        // Initially visible.

        );

        // CreateNewDialog takes the dialogSpec created above, and also

        // the type of dialog being created (kMovableModal).

        IDialog* dialog = dialogMgr->CreateNewDialog(dialogSpec, IDialog::kMovableModal);

        if (dialog == nil)

        {

            ASSERT_FAIL("BscDlgActionComponent::DoDialog: can't create dialog");

            break;

        }

When I use kSDKDefDialogResourceID, it creates dialog, which was defined in my plugin resource file not a standard export dialog

What shoul I use instead kBscDlgPluginID and  kSDKDefDialogResourceID?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 01, 2013 Mar 01, 2013

Copy link to clipboard

Copied

LATEST

The sollution is the following:

1. Make an AddIn to kDocBoss with new interface e.x. IExportToPNG

2. In implementation of IExportToPNG, use SnapshotUtilsEx.

P.S.

The right order of using SnapshotUtilsEx is:

1. Use constructor of SnapshotUtilsEx(...)

2. SnapshotUtilsEx::Draw(...)

3.  SnapshotUtilsEx::ExportImageToPNG(...)

Regards!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines