Frederick Posted August 19, 2019 Share Posted August 19, 2019 I use the above component to display my PDF files and I would like to move or hide some menu options for better clarity and reduced ambiguity. 1) How do I move the "Go To First Page" and "Go To Last Page" menus to next to the other page positioning menus? It is a logical place for them to be. 2) What is the purpose of the "Open File" menu and can it be hidden? 3) What is the purpose of the "Current View" menu and can it be hidden? 4) Can the "Document Properties" menu be hidden? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1508) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 19, 2019 Share Posted August 19, 2019 1 hour ago, Frederick said: 2) What is the purpose of the "Open File" menu and can it be hidden? 3) What is the purpose of the "Current View" menu and can it be hidden? 4) Can the "Document Properties" menu be hidden? procedure TMainForm.UniPDFFrame1FrameLoaded(Sender: TObject); begin // download button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("download").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryDownload").style.display = "none"'); // open file button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("openFile").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryOpenFile").style.display = "none"'); // view bookmark button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("viewBookmark").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryViewBookmark").style.display = "none"'); // documentProperties UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("documentProperties").style.display = "none"'); end; 2 Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted August 19, 2019 Share Posted August 19, 2019 Good, and Disable Print File? Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 19, 2019 Author Share Posted August 19, 2019 7 hours ago, Sherzod said: // open file button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("openFile").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryOpenFile").style.display = "none"'); Hi Sherzod, When I added the above code in the OnShow event of the form to hide the "Open File" menu, I received the following Ajax error message:- OFB=new Ext.window.Window({id:"OFB_id",retfalse:{},onEsc:Ext.emptyFn,layout:"fit",title:"Print Reports",modal:true,closeToolText:"",maximizable:false,minimizable:false,resizable:false,iconCls:"x-uni-icon-contain",uniFMask:{beforeclose:true},width:977,height:711,x:451,y:129});OFB.nm="OFB";_cdo_("frmReports");frmReports.ajxS=AjaxSuccess;frmReports.ajxF=AjaxFailure;OFB.rootObj=true;frmReports.appRoot="/";_cdo_(null,OFB,"window",frmReports); O103=new Ext.form.Panel({id:"O103_id",border:false,uActive:false,tabItems:new Ext.util.MixedCollection(),layout:"absolute"});O103.nm="O103";_cdo_(null,O103,"form",frmReports);OFB.add(O103); O10B=(function(P0){return Ext.xR("this="+P0.nm+""+_gv_(O103),OFB,"beforeclose");});O10B.nm="O10B";OFB.on("beforeclose",O10B); O10C=(function(P0){_saf_(P0);return Ext.xR("this="+P0.nm+""+_gv_(O103),OFB,"activate");});O10C.nm="O10C";OFB.on("activate",O10C); O10D=(function(P0){return Ext.xR("this="+P0.nm+""+_gv_(O103),OFB,"deactivate");});O10D.nm="O10D";OFB.on("deactivate",O10D);OFB.on("deactivate",function(f){_sdf_(f)}); O10E=new Ext.panel.iframe({id:"O10E_id",border:false,bodyBorder:false,layout:"absolute",ifName:"name_pdfFrame_O10E",items:[{xtype:"component",width:"100%",height:"100%",autoEl: {tag:"iframe",onload:"iframe_load('O10E_id')",name:"name_pdfFrame_O10E",title:"title_pdfFrame_O10E",src:"about:blank",frameborder:"0"}}],style:"border:none;",width:967,height:670,x:0,y:0});O10E.nm="O10E";_cdo_("pdfFrame",O10E,null,frmReports);O103.add([O10E]);uniVars._loginFrm=null;O103.keyprv=true; O116=(function(P0,P1,P2){return Ext.xR("this="+P0.nm+"&w="+P1+"&h="+P2+""+_gv_(O103),OFB,"resize");});O116.nm="O116";OFB.on("resize",O116); O117=(function(P0,P1,P2){return Ext.xR("this="+P0.nm+"&x="+P1+"&y="+P2+""+_gv_(O103),OFB,"move");});O117.nm="O117";OFB.on("move",O117); O118=(function(P0){return Ext.xR("this="+P0.nm+""+_gv_(O103),OFB,"maximize");});O118.nm="O118";OFB.on("maximize",O118); O119=(function(P0){return Ext.xR("this="+P0.nm+""+_gv_(O103),OFB,"minimize");});O119.nm="O119";OFB.on("minimize",O119); O11A=(function(P0){return Ext.xR("this="+P0.nm+""+_gv_(O103),OFB,"restore");});O11A.nm="O11A";OFB.on("restore",O11A);OFB.show("");OFB.retfalse.beforeclose=1;_axy_(OFB);OFB.uniMask={ldMask:false,maskWaitData:false,maskUseMsg:true};OFB.uniMask.targetObj=null;O10E.iframe.contentWindow.document.getElementById ("openFile").style.display = "none";O10E.iframe.contentWindow.document.getElementById ("secondaryOpenFile").style.display = "none";O10E.initIFrame();O10E.setUrl("/uni-1.90.0.1508/pdf.js/web/viewer.html?file=/cache/icaratcontrol_exe/YSPY5xWoYV10474C455/KNXBFK190820065159954.pdf"); The browser is Opera and I am using Windows 10 Professional x 64. I have not tested the other JS calls. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2019 Share Posted August 20, 2019 3 hours ago, Frederick said: When I added the above code in the OnShow event of the form to hide the "Open File" menu, I received the following Ajax error message:- Hi, You should use UniPDFFrame OnFrameLoaded event for this! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2019 Share Posted August 20, 2019 7 hours ago, rtalmeida said: and Disable Print File? // print button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("print").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryPrint").style.display = "none"'); 1 Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 20, 2019 Author Share Posted August 20, 2019 3 hours ago, Sherzod said: Hi, You should use UniPDFFrame OnFrameLoaded event for this! Thanks. I missed the event call. All buttons you provided the code for now work. However, is there a way to move the first and last position buttons? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2019 Share Posted August 20, 2019 1 minute ago, Frederick said: However, is there a way to move the first and last position buttons? Please explain, where do you need to move them? Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 20, 2019 Author Share Posted August 20, 2019 Per the image of my first post, the black arrows point to where they should be. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2019 Share Posted August 20, 2019 13 minutes ago, Frederick said: Per the image of my first post, the black arrows point to where they should be. Ok need to analyze. Quote Link to comment Share on other sites More sharing options...
EDOM Posted June 15, 2020 Share Posted June 15, 2020 Is there a way to hide moreInfoButton Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 15, 2020 Share Posted June 15, 2020 3 minutes ago, EDOM said: Is there a way to hide moreInfoButton And what is this button? Quote Link to comment Share on other sites More sharing options...
EDOM Posted June 15, 2020 Share Posted June 15, 2020 15 minutes ago, Sherzod said: And what is this button? When read PDF file error, PDF viewer will show "Missing PDF file." and the "More Info" button The button for "more info" will show the full path of the file, and I want to hidden this information. But I have tried it out, with this code can hide the "More Info" button UniSession.AddJS (UniPDFFrame_Cert.JSName + '.iframe.contentWindow.document.' + 'getElementById ("errorShowMore").style.display = "none"'); 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 15, 2020 Share Posted June 15, 2020 So the question is solved? Quote Link to comment Share on other sites More sharing options...
EDOM Posted June 15, 2020 Share Posted June 15, 2020 1 hour ago, Sherzod said: So the question is solved? solved, thank you very much Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 10, 2021 Share Posted June 10, 2021 Quote procedure TMainForm.UniPDFFrame1FrameLoaded(Sender: TObject); Hi I read my table and load in Unipdfframe ,when the field is null ,the following error is displayed, Cannot read property 'style' of null of course if I use below code procedure TMainForm.UniPDFFrame1FrameLoaded(Sender: TObject); begin // download button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("download").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryDownload").style.display = "none"'); . . . Cannot read property 'style' of null Reagards. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 10, 2021 Share Posted June 10, 2021 5 minutes ago, A.Soltani said: I read my table and load in Unipdfframe ,when the field is null ,the following error is displayed. Hello, How can we reproduce this issue? Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 10, 2021 Share Posted June 10, 2021 Hi Can I call UniPDFFrameloaded ,when my table has value ? Regards. Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 10, 2021 Share Posted June 10, 2021 Quote How can we reproduce this issue? Are you have Testcase? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 10, 2021 Share Posted June 10, 2021 24 minutes ago, A.Soltani said: Can I call UniPDFFrameloaded ,when my table has value ? UniPDFFrame1.PdfURL := ? Quote Link to comment Share on other sites More sharing options...
azago Posted June 10, 2021 Share Posted June 10, 2021 procedure TfForm1.UniPDFFrame1Loaded(Sender: TObject); begin if UniPDFFrame1.PDFURL > '' then begin // download button UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("download").style.display = "none"'); UniSession.AddJS (UniPDFFrame1.JSName + '.iframe.contentWindow.document.' + 'getElementById ("secondaryDownload").style.display = "none"'); end; end; 1 Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 10, 2021 Share Posted June 10, 2021 Hi I create Uploadfolder in my app directory and set UniPDFFrame1.PdfURL := uploadfolder+mypdffile; regards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.