Solution for silent-kiosk print on CefSharp? - chromium

I want to print my web page silently ( to default printer) with "window.print()" command on CefSharp. CefSharp handles the documents and print very good but i can't prevent printer dialog screen. Is there any option or method to prevent printerdialog ?
DotNetBrowser provides silent print functionality but it has page scrolling problem and it is slower than ChefSharp.
Thanks

Related

PDFtron close a tool when doing Frame.GoBack()

Im using PDFtron on a windows store app project.
I have a page with a back button and a pdf viewer where i can edit the pdfs.
When im editing a pdf i have a tool bar with options like the ones in the samples, but i have a issue when i choose a Free Text tool and start writing on the pdf, if i press the back button while the Free Text tool is active ( the cursor is bliking) the text i wrote appears in the screen on the next page i navigate to.
How can i solve this?
The TextBox in question is part of the PDFViewCtrlTools that are used to create annotations. It is shipped with the sample application and is fully open source.
The TextBox is inside a popup, positioned to align itself on top of the PDFViewCtrl in the position where you tapped.
This TextBox needs to be closed before you go back. It is quite easy to do so by calling ToolManager.CreateDefaultTool(). In general, I would recommend taking a look at the samples and see what they're doing when the user tries to navigate away from the page.
Everytime you navigate away from a page with PDFViewCtrl, the ToolManager should call CreateDefaultTool so that whatever current tool is active (in this case the FreeTextCreate tool) can close itself and clean up.

Autoclose Macro in a PDF

For testing purposes I am trying to create a PDF that, upon opening, automatically closes itself and closes Acrobat Reader. Similar to having an Auto_Open macro in Word that executes: Application.Quit.
I have Acrobat Professional 9.0 but I cannot see how to do that. However, I see discussions of "Actions" (Acrobat Macros) on the Acrobat website.
Thanks.
Actions are not quite what you are looking for…
And Acrobat/Reader can not completely do what you are asking it for… For security reasons, it is not possible to programmatically terminate Acrobat/Reader. So, Quitting is not possible; all you can do is closing the document.
You would use Acrobat JavaScript for that. In order to see that it really works, I suggest to first try out a two-page document. To the second page, you add the following PageOpen script (later on, you can do that with the first page too):
this.dirty = false ;
this.closeDoc() ;
You create a PageOpen script by displaying the page tumbnails, and then select the context menu of the page you want to access. There you open the Page Properties… dialog, and switch to the Page Actions tab. Select Run a JavaScript as action for PageOpen, and add the code above.
Update, after comment by Neil Weicher :
If you want to delay the closing, you could use the setTimeOut() method, as showing in this example (which also uses the argument for closing the document without asking whether to save (the equivalent of setting the dirty flag to false); the delay is 5 seconds (5000 milliseconds)):
myDelay = app.setTimeOut("this.closeDoc(true) ; app.clearTimeOut(myDelay) ;" , 5000) ;
Note: although the timeout object should get reset when the document closes, it is safer to do it in the delayed script.
And that should do it.

print option is not displayed in report viewer

I'm working on RDLC reports in ASP.NET, and rendering a report in a report viewer. It displays the print option at design time, but it disappears at runtime even if I set the property ShowPrint to true.
The print button unfortunately relies on ActiveX, which is only available on Internet Explorer, and so the print button is not present when using other browsers. You can still generate a .pdf file and then print that, effectively getting the same result.

Disable Adobe Reader toolbar from my ActiveX

I am loading a PDF document in my ActiveX using AxAcroPDFLib and iTextSharp libraries. I want to disable the toolbar (that have Save, Print etc options) from the loaded PDF so that user cannot 'Save' the PDF from ActiveX.
I have following code:
axAcroPDF1.Width = someWidth;
axAcroPDF1.Height = someHeight;
axAcroPDF1.LoadFile(documentPath);
axAcroPDF1.setPageMode("none");
axAcroPDF1.setShowToolbar(false);
axAcroPDF1.Show();
axAcroPDF1.Focus();
The axAcroPDF1.setShowToolbar(false) disables the toolbar but the other gray toolbar enables at the bottom ( as shown in figure on this link) of PDF when I move mouse in that area. That toolbar also have saving option in it and I want to disable this one as well.
It would be really nice if it allows to disable only 'Save' option and keep the other options enabled on toolbar.
I success using
this.axAcroPDF1.src = filePath + "#toolbar=0";
You are asking something that is impossible. Please read this thread dating from December 2011. You'll find a snippet where Leonard Rosenthol, Adobe's PDF architect says: "there is no way to hide the toolbar (or the HUD) in the browser."
Setting the toolbar to false works for the toolbar, but you are referring to the "Heads Up Display" (HUD). As documented by Adobe, there is no way to customize this feature, let me quote Adobe:
the "Heads Up Display" (HUD) is not customizable. There are no APIs to
HUD. You can’t use JavaScript to enter Read Mode, exit Read Mode or
detect that the document is in Read Mode. Though it might seem like
it, this wasn’t an oversight. There are some very sound engineering
reasons why this is the case but I won’t go into those here.
I got succeed using
axAcroPDF.src = filepath + "#toolbar = 0"

is it possible to close MS Windows print pop up window using selenium

is it possible to close print pop up window using selenium..
Scenario is, on clicking print icon a pop up opens with preview and on top of it MS Windows Print pop up comes.
I could able to do validation in the preview window but unable to close the window because the presence of MS Windows print. SO this window always present in open state while executing other cases, i mean my cases are running but its blocking the view, almost half screen.
So i want to close the MS Windows Print pop-up and the i can close the preview window by selenium because it has 'Close' link
Computer Says No.
from the selenium cor faq :
...Currently there is not much that can be done about IE modal
dialogs.
I have a messy workaround right now that involves using AutoIT (http://www.autoitscript.com/site/autoit/) to just press alt + f4, I wrote a simple script, compiled it, and called it from my C# code, that I'm running on Selenium RC. I'm looking for a better way now since this is only a workaround, a quick fix allowing me to run it until I can write it in a cleaner way.
Code for AutoIT:
; Script Start
WinClose("Window Name")
C# Code
Process.Start("WindowClose.exe");