printdialog

Intercepting PrintDialog to XPS Document Writer

痞子三分冷 提交于 2021-01-28 03:03:20
问题 Currently I am providing the user with two controls: Save and Print. When the user selects Save, a region of the WPF display is packaged up and sent through a XpsDocumentWriter and the user is prompted and encouraged to sign the new xps document. When the user selects Print, a PrintDialog.PrintVisual prints that same region to a user selected printer. All well and good, except that Microsoft XPS Document Writer is one of the choices for printers. Is there a way to prevent or intercept the

IE or Edge Print dialog box send request to server without session (because SameSite=Lax on session cookie)

江枫思渺然 提交于 2020-02-25 07:17:29
问题 I have a asp.net site, which users can login and members can get report or print page by Ctrl+P. Recently when my members open my site in IE and try to print, they are logged out! why? because IE print dialog send some request to server without session cookie, so StateServer release new session for this client and then user logged out. Why print dialog sent request? I don't know, but i guess IE print dialog try to renders page and ready it for print. Why print dialog don't sent current

Why does this URL do different things depending on how it's activated?

ⅰ亾dé卋堺 提交于 2020-01-24 20:54:06
问题 In a related post (here) I discuss a problem I'm having with a URL action in a SQL Server Reporting Services report. I thought I had solved the problem, but I now realize that I haven't. (I'll update the related post in due course.) I'm generating a URL using string concatenation, and using Javascript so the URL opens in a new browser tab. Here's the code that generates the URL, which I think is pretty standard: ="javascript:void(window.open('http://www.ic.gc.ca/app/opic-cipo/trdmrks/srch

How to print a Workbook file made using Apache Poi and java?

狂风中的少年 提交于 2020-01-11 11:25:49
问题 I create one page workbook files in eclipse and need to open the print dialog box and print these files off. I understand how to open the print dialog box and everything, i just can't find how to tell the system that it is the workbook file "wb" that is what i'm wanting to print. So opening the dialog just doesn't work unless it knows what i'm trying to print with it. Could someone at least send me in the right direction Without telling me to read the java print dialog tutorials. I've read

How can I change text on a win32 window?

a 夏天 提交于 2020-01-09 08:09:05
问题 Looking for hints, tips and search terms for changing the text on a win32 window from C#. More specifically, I'm trying to change the text on the print dialog from "Print" to "OK", as I am using the dialog to create a print ticket and not do any printing. How can I find the dialog's window handle? Once I've got it, how would I go about finding the button in the child windows of the form? Once I've found that, how would I change the text on the button? And how can I do all this before the

Print range not working even if values are set

强颜欢笑 提交于 2019-12-24 14:27:17
问题 I have a simple printing solution set up and normal printing works fine(tested it a couple of times), however when I use the PrintDialog to specify a custom page range, it is as if the range is ingored. When I debug I inspect the printDocument object and confirm that the range values are correct but the end product that the printer produces does not much the values I gave it. Here is my code : printDialog.Document = printdoc; printDialog.AllowSomePages = true; if (printDialog.ShowDialog() ==

Print multiple pages from TextBox

大兔子大兔子 提交于 2019-12-24 00:45:50
问题 private void PrintTextBox(object sender, PrintPageEventArgs e) { e.Graphics.DrawString(textBox1.Text, textBox1.Font, Brushes.Black, 50, 20); } private void printListButton_Click(object sender, EventArgs e) { PrintDocument pd = new PrintDocument(); pd.PrintPage += PrintTextBox; PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = pd; ppd.ShowDialog(); } I tried in PrintTextBox method using the e.HasMorePages == true but then it continously started to add pages. Do you have any

Win32 PrintDlg, PrintDlgEx, Crashing and quirkiness

ぐ巨炮叔叔 提交于 2019-12-22 09:49:05
问题 I'm tasked with solving the following issue: My application crashes when running on a 64 bit machine when the PrintDlg() function is called. After digging and hair pulling, I've decided the best solution is to replace the original calls of PrintDlg() with its bigger brother, PrintDlgEx(). Doing so fixes one problem (it no longer crashes!), but causes another. When I execute the code, it is not showing the print dialog, just returning a success code, and giving me all of the information for my

fitting PrinterJob Object to specific print format of BufferedImage

穿精又带淫゛_ 提交于 2019-12-18 09:49:08
问题 Im using PrinterJob object in order to print my Bufferedimage, I have a BufferedImage which I proccess and send it to Printer job with Paper Format etc, and I cant make it fittable to my card printer. when i save it to my hard-disk and print via windows printing manager it printing very good on my card printer but with PrinterJob it came out too big and not fittable for a card the size of the card is 86X54mm and the size of my buffered image is 1300x816px The Code : PrinterJob printjob =

How to get Printer Info in .NET?

不想你离开。 提交于 2019-12-17 02:12:14
问题 In the standard PrintDialog there are four values associated with a selected printer: Status, Type, Where, and Comment. If I know a printer's name, how can I get these values in C# 2.0? 回答1: As dowski suggested, you could use WMI to get printer properties. The following code displays all properties for a given printer name. Among them you will find: PrinterStatus, Comment, Location, DriverName, PortName, etc. using System.Management; ... string printerName = "YourPrinterName"; string query =