How to automatically add *.pdf using AVOpenSaveDialogParams?

Community Beginner ,
May 28, 2018

Copy link to clipboard

Copied

Currently I have the following piece of code.

I would only want the user to save the file as PDF with *.pdf extension.

However, with the following code, I have to input *.pdf at the end of the filename.

Is there a way to automatically add *.pdf at the end of the filename?

Your help is greatly appreciated.

AVFileFilterRec* fileFilters = NULL;   

dialogParams.size = sizeof(dialogParams);

    dialogParams.flags = kAVOpenSaveAllowAllFlag;

    dialogParams.parentWindow = NULL;

    dialogParams.windowTitle = NULL;

    dialogParams.actionButtonTitle = NULL;

    dialogParams.initialFileSys = NULL;

    dialogParams.initialPathName = NULL;

    dialogParams.initialFileName = ASTextNew();

    dialogParams.fileFilters = &fileFilters;

    dialogParams.numFileFilters = 0;

    dialogParams.settingsComputeEnabledProc = NULL;

    dialogParams.settingsExecuteProc = NULL;

    dialogParams.settingsProcData = NULL;

    dialogParams.showExportCheckbox = true;

    outDialogParams.chosenFileSys = NULL;

    outDialogParams.chosenPathName = NULL;

    outDialogParams.chosenFilterIndex = 0;

    outDialogParams.launchFile = 0;

Most Valuable Participant
Correct answer by Test Screen Name | Most Valuable Participant

Have you tried filling in the file filters?

TOPICS
Acrobat SDK and JavaScript

Views

151

Likes

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

How to automatically add *.pdf using AVOpenSaveDialogParams?

Community Beginner ,
May 28, 2018

Copy link to clipboard

Copied

Currently I have the following piece of code.

I would only want the user to save the file as PDF with *.pdf extension.

However, with the following code, I have to input *.pdf at the end of the filename.

Is there a way to automatically add *.pdf at the end of the filename?

Your help is greatly appreciated.

AVFileFilterRec* fileFilters = NULL;   

dialogParams.size = sizeof(dialogParams);

    dialogParams.flags = kAVOpenSaveAllowAllFlag;

    dialogParams.parentWindow = NULL;

    dialogParams.windowTitle = NULL;

    dialogParams.actionButtonTitle = NULL;

    dialogParams.initialFileSys = NULL;

    dialogParams.initialPathName = NULL;

    dialogParams.initialFileName = ASTextNew();

    dialogParams.fileFilters = &fileFilters;

    dialogParams.numFileFilters = 0;

    dialogParams.settingsComputeEnabledProc = NULL;

    dialogParams.settingsExecuteProc = NULL;

    dialogParams.settingsProcData = NULL;

    dialogParams.showExportCheckbox = true;

    outDialogParams.chosenFileSys = NULL;

    outDialogParams.chosenPathName = NULL;

    outDialogParams.chosenFilterIndex = 0;

    outDialogParams.launchFile = 0;

Most Valuable Participant
Correct answer by Test Screen Name | Most Valuable Participant

Have you tried filling in the file filters?

TOPICS
Acrobat SDK and JavaScript

Views

152

Likes

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
May 28, 2018 0
Most Valuable Participant ,
May 29, 2018

Copy link to clipboard

Copied

Have you tried filling in the file filters?

Likes

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
Reply
Loading...
May 29, 2018 1
Community Beginner ,
May 29, 2018

Copy link to clipboard

Copied

I am not sure what to place in the filters. Is there any documentation on this portion?

Likes

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
Reply
Loading...
May 29, 2018 0
sfc11245 LATEST
Community Beginner ,
May 29, 2018

Copy link to clipboard

Copied

Seems like I can use AVFileDescRec for this.

Likes

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
Reply
Loading...
May 29, 2018 0