printing

Another knack on the “Dialogs must be user-initiated” Security Exception in Silverlight printing

我只是一个虾纸丫 提交于 2019-12-12 18:36:41
问题 I get the infamous "Dialogs must be user-initiated" Security Exception when I try to print some stuff in Silverlight. As you can see, the dialog is as user-initiated as can be: John Papa couldn't help me much out neither, because I don't have any breakpoint set. Mr MSDN thinks it could also be that I'm just taking too long, but this is a demo application just as simple as can be. Any ideas? I guess it's a Visual Studio quirk, maybe some extensions interfering, as things seems to work when I

make a div at the bottom of a specific page on printing

天涯浪子 提交于 2019-12-12 18:18:54
问题 I have a table with variable number of rows. I want to print that table via browsers. Below it, there's a div that should remain at the bottom of the page. If the table is contained in the first page, the div will be at bottom of the first page. If the table overflow to the second page, the div will be a the bottom of the second page and so on,... My first approach was to handle it like I used to do in HTML .footer{ width: 100%; position: absolute; bottom: 0; font-size: 10pt; } This is not

Is it advisable to use print statements in a python function rather than return

谁说我不能喝 提交于 2019-12-12 18:08:56
问题 Lets say I have the function: def function(a) c = a+b print(c) Is it advisable to use the print statement in the function to display output rather than placing a return statement at the end and using the print(function(a)) ? Also what implications would there be if I used both a print statement and a return statement in a function to display the same output? Lets imagine I need to show the answer for c and then use the value of c somewhere else. Does this break any coding conventions? So the

How can I make the printer work in C in MS VC++ Express edition?

半世苍凉 提交于 2019-12-12 18:06:38
问题 I am using VC++ 2008 express edition for C. When I try to run this: /* Demonstrates printer output. */ #include <stdio.h> main() { float f = 2.0134; fprintf(stdprn, "This message is printed.\n\n"); fprintf(stdprn, "And now some numbers:\n\n"); fprintf(stdprn, "The square of %f is %f.", f, f*f); /* Send a form feed */ fprintf(stdprn, "\f"); } I get four of these errors: error C2065: 'stdprn' : undeclared identifier. On this forum, they wrote that it works to define the printer as follows: FILE

@media Print text-shadow under Chrome

拜拜、爱过 提交于 2019-12-12 17:41:28
问题 When I add the css rule " text-shadow " for text it does not shown in @media print (save as PDF) and it does not work specially under Chrome . It works excellent under IE11 but under Chrome - not! It makes me very -very disappointed! Here is the simple text-shadow example: .item { text-shadow: 4px 4px 1px #ccc; } So the question is how to force print " text-shadow " under Chrome ? In my case it also should be multiple shadows, something like that: .item { text-shadow: 1px 0 0 #fff, 0 1px 0

create ZPL to print a PNG-image with JAVA

廉价感情. 提交于 2019-12-12 17:40:47
问题 I want to create a ZPL2-Code, that prints a given PNG-Image. I tried e.g. Labelary Online (http://labelary.com), but I am not able to create the correct image-coding. I converted my PNG to a b/w-image, converted the byte-array to a Hex-String and inserted it like this: ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(bwImage, "png", baos); byte[] bytes = baos.toByteArray(); System.out.println("^XA^GFA," + bytes.length + "," + bytes.length + "," + bytes.length / 8 + ","

Real size WPF controls for printing

混江龙づ霸主 提交于 2019-12-12 17:15:36
问题 I am currently developing an application where users can create/move TextBlocks on a canvas dynamically. Once they have positioned the TextBlocks where they want them they can press a print button which will cause a ZPL printer to print what is currently displayed on screen. The ZPL commands are built by taking the following values from each TextBlock: XPosition = Canvas.Left YPosition = Canvas.Right Text = Text However I can't find a way of getting the printout to resemble the on screen

Printing with exactly 1 space if a single digit?

那年仲夏 提交于 2019-12-12 17:06:39
问题 I'm printing an integer, that may be 1 or 2 digits long. I'm using : print str(myInt) However, I want it to always print out something that is 2 'spaces' long. As in if myInt is only 1 digit, then I want it to be padded with a space then print out the digit. Is there a simple way to do that? sample output of what I want: 1 15 20 3 回答1: >>> print '{:2}'.format(1) 1 >>> print '{:2}'.format(23) 23 回答2: import re x=[1,15,20,3] print [re.sub(r"^0"," ",str(i).zfill(2)) for i in x] Output: [' 1',

Printing to a Printer DC with MFC

荒凉一梦 提交于 2019-12-12 16:52:41
问题 I've followed Microsoft's tutorial on creating a Device Context, and I've tried looking around the internet for a decent source (apparently, MFC is a mystical thing). The following successfully prints out "Hello, World!"; except it's extremely tiny. How can I send a CImage to the printer, rather than text? And how could I get the text's size to be bigger than a couple millimeters? I've scoured MSDN, but everything is either outdated (like the example code I am using), or just not well

How to determine printer's postscript support using Win32 API?

为君一笑 提交于 2019-12-12 16:16:38
问题 I'm developing remote printing client (native Win32 app). It simply prints files that come from server. I wish to have the ability to programmatically check if printer supports Postscript before sending data to it. How it can be done? GETTECHNOLOGY escape doesn't help much. Say it returns "PCL XL" for HP printers that also support Postscript. 回答1: I don't think there's any way to be certain from the Win32 API that a printer is a PostScript printer,if it accepts multiple Page Description