node.jspdfpdftronpdfa

error by using in PDFTron:' NetworkError(`Unsupported protocol ${this._url.protocol}`'


I trying to convert pdf file to pdfa3 file by using PDFTron. I added current url_path. the my code below:

 var input_url = './utils/';
            var input_filename = 'test.pdf';
            var output_filename = 'test_pdfa.pdf';
            var convert = true;
            var pwd = '';
            var exceptions;
            var max_ref_objs = 10;
            var url_input = input_url + input_filename;
            
            console.log('Converting input document: ' + input_filename);
            var pdfa = await PDFNet.PDFACompliance.createFromUrl(true, url_input, '', PDFNet.PDFACompliance.Conformance.e_Level2B, exceptions, max_ref_objs);

get error: 'NetworkError(Unsupported protocol ${this._url.protocol})',

Does anyone know what the problem is, And why doesn't it recognize the location?


Solution

  • I changed the code to : here.

    Now it's working!!