Sergii Posted February 20 Share Posted February 20 Добрый день. Подскажите как из программы вызывать метод "печать" и "скачать" из TUniPDFFrame. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 20 Share Posted February 20 2 hours ago, Sergii said: Подскажите как из программы вызывать метод "печать" и "скачать" из TUniPDFFrame. Добрый день, Один из возможных вариантов решения. 1. UniPDFFrame1.ClientEvents.ExtEvents -> function afterrender(sender, eOpts) { sender._setCmd = function(command) { sender.iframe.contentDocument.getElementById(command).click() } } 2. Использование: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniPDFFrame1.JSInterface.JSCall('_setCmd', ['print']); // 'download' end; 1 Quote Link to comment Share on other sites More sharing options...
Volk65 Posted February 20 Share Posted February 20 54 minutes ago, Sherzod said: Один из возможных вариантов решения. Спасибо за ответ. Я правильно понимаю, что в случае "print" сразу происходит печать на принтере по умолчанию? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 21 Share Posted February 21 9 hours ago, Volk65 said: Спасибо за ответ. Я правильно понимаю, что в случае "print" сразу происходит печать на принтере по умолчанию? Спасибо. Нет, диалоговое окно печати. Quote Link to comment Share on other sites More sharing options...
Sergii Posted February 21 Author Share Posted February 21 Спасибо. Работает. 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.