Announcement

Collapse
No announcement yet.

FoxitWeb.8.2.1-Cannot add a new menu item to the thumbnail uix-addons RC menu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lisa_lee
    replied
    adaml ,For Foxit SDK related query/issue, please help to submit a ticket from our ticket submission center and our SDK engineers will reply to your ticket as soon as possible.

    Leave a comment:


  • FoxitWeb.8.2.1-Cannot add a new menu item to the thumbnail uix-addons RC menu

    Hello,
    I want to add a new menu item after add-blank-page item menu.
    please see my code below:


    Code:
    var duplicatePageFragment = {
                target: 'contextmenu-item-thumbnail-add-blank-page',
                action: FRAGMENT_ACTION.AFTER,
                template: '<contextmenu-item  name="contextmenu-item-thumbnail-duplicate-page">Duplicate Page</contextmenu-item>',
                config: [{
                    attrs: {
                        // This attribute is necessary if the specified component is not marked by it, otherwise it is optional
                        '@tooltip': '',
                        'tooltip-title': "Duplicate Page"
                    },
                    target: 'contextmenu-item-thumbnail-duplicate-page',
                    callback: function () {
                        this.getPDFUI()
                            .getPDFViewer()
                            .then(pdfViewer => {
                                var pdfdoc = pdfViewer.getCurrentPDFDoc();
                                var currentIndex = this.component.parent.getCurrentTarget();
                                var destIndex = currentIndex + 1,
                                    password = "",
                                    flags = "",
                                    layerName = "",
                                    startIndex = "",
                                    endIndex = "";
                                extractPages(pdfdoc, currentIndex).then((buffer) => {
                                    let blob = new Blob(buffer, { type: 'application/pdf' });
                                    pdfViewer.getCurrentPDFDoc().insertPages({ destIndex: Number(destIndex), file: blob, password: password, flags: Number(flags), layerName: layerName, startIndex: Number(startIndex), endIndex: Number(endIndex) });
                                })
                            });
                    }
                }]
            };
    
    
    var pdfui = new PDFUI({
                    viewerOptions: {
                        libPath: '../../../lib',
                        jr: {
                            readyWorker: readyWorker
                        }
                    },
                    renderTo: '#pdf-ui',
                    appearance: UIExtension.appearances.adaptive,
                    fragments: [duplicatePageFragment],
                    addons: UIExtension.PDFViewCtrl.DeviceInfo.isMobile ?
                        '../../../lib/uix-addons/allInOne.mobile.js' :
                        '../../../lib/uix-addons/allInOne.js'
                });
    On the FoxitPDFSDKForWeb_8.1.1 its works just fine but after i have upgraded to the new FoxitPDFSDKForWeb 8.2.1 version, I’m getting the following messages "Uncaught (in promise) Error: target component not found: "contextmenu-item-thumbnail-add-blank-page".

    Please advice,

    Thanks,
    Adam.
    Attached Files
    You do not have permission to view this gallery.
    This gallery has 2 photos.
    Last edited by adaml; 01-31-2022, 08:30 AM.
Working...
X