File not a function Error is occured while trying to Export indd as pdf

Hi

I am trying to export indd file to pdf using uxp scripting. But it show some error like in below screenshot

Kindly please help me to rectify this issue.

document.getElementById("dak-print").addEventListener("click" , function()
{
    const {app,ExportFormat } = require('indesign');
    const {File} = require('uxp').storage;

    var doc = app.activeDocument;
    doc.exportFile(
        ExportFormat.pdfType,
        File(page_loc + "\\"+pdf_filename+".pdf"),
        false
    );
});

This is my code…
Please help…

Use a string representing the path, instead of a File object.

 doc.exportFile(
        ExportFormat.pdfType,
       page_loc + "\\"+pdf_filename+".pdf",
        false
    );
1 Like