printing

How to find out the dimensionality of print paper in javascript

落花浮王杯 提交于 2020-01-14 03:11:09
问题 I am generating reports in HTML formats, and want to print them automatically using Qt (qt has a webkit based browser, and one can render its contents to a PDF file). I want to position the elements of the report depending on the target page size. For that i need to access the size of the paper (preferably in pixels). Since i am using webkit, it has all the latest html5 and css3 features. is there some api available to access printed page properties inside javascript. for example, would be

How to print Lua table using the redefined print function?

南楼画角 提交于 2020-01-14 02:48:26
问题 I learned how to redefine the Lua's print() in C++ from this post. (https://stackoverflow.com/a/4514193/5224286) Here's the redefined print function that prints variables to my host program's console. (through the functions named post.. ) int l_my_print(lua_State *L) { int nargs = lua_gettop(L); for (int i = 1; i <= nargs; ++i) { if (lua_isnil(L, i)) poststring("nil"); else if (lua_isboolean(L, i)) lua_toboolean(L, i) ? poststring("true") : poststring("false"); else if (lua_isnumber(L, i))

Dumping contents of Array Obj-c to consoler

白昼怎懂夜的黑 提交于 2020-01-14 02:47:13
问题 I looked for how to dump and array to the console I have mostly found: for (id name in arrayStuff) NSLog (@"Array contents: %d", name); I've tried different formaters %d %@ %g etc. which does print different stuff, but not the values I'm 99% sure are being entered into the object and consequently the array. This doesn't seem to work, how would you know what to use as the formater? I have an NSMutableArray with instance of an object containing one int and two doubles added to the array in each

get printed page number of an element

依然范特西╮ 提交于 2020-01-13 20:36:10
问题 I'm working on a project that is involving converting PDF handbooks to html. I am trying to retain the value of a PDF when printed, while giving them a better ui on devices which aren't bound by the concept of pages. The issue that I am running into is that these handbooks have a Table of Contents with the page number of where each chapter/section begins. When viewing on a device, that list will just be in-page anchor links, but when printing I would like to get the page number of an element

Is there a pretty printing (or showing) abstraction in Haskell?

北慕城南 提交于 2020-01-13 19:55:11
问题 Is there no standard way to print out values for end-user consumption? Show is clearly more of a debugging convenience than something that would work for this purpose, given the conventions around its use and the constraint that read (show x) == x . For example, isn't there at least a simple package like class (Show a) => PShow a where pshow :: a -> String pshow = show pprint :: (PShow a) => a -> IO () pprint = putStrLn . pshow where instances do something like instance PShow MyType where

PrintDialog.PrinterSettings equivalent in WPF

我与影子孤独终老i 提交于 2020-01-13 12:04:25
问题 I'm trying to add printing support to a C# WPF application I'm writing and I'm tearing my hair out over this. I'm trying to print a single image from a window in a WPF application. The image is a shipping label and the printer is a thermal printer loaded with 4"x6" shipping label stock. The code to print is as follows: PrintDialog pd = new PrintDialog(); if (pd.ShowDialog() == true) { Image tmpImage = new Image(); tmpImage.Stretch = Stretch.Uniform; tmpImage.Width = pd.PrintableAreaWidth;

Setting margins, headers and footers for PDF without overlap

烂漫一生 提交于 2020-01-13 10:22:18
问题 I need some help with tweaking my PDF header/footer alongside my text areas. The first page looks okay and it just gets worse from there. Is the header and footer eating into my existing margin spaces? I would like to know what is going wrong and what I can tweak to set the below: Page widths Margin widths Header Footer Text area My header override function is as below: public partial class Header : PdfPageEventHelper { public override void OnStartPage(PdfWriter writer, Document doc) {

Setting margins, headers and footers for PDF without overlap

眉间皱痕 提交于 2020-01-13 10:21:09
问题 I need some help with tweaking my PDF header/footer alongside my text areas. The first page looks okay and it just gets worse from there. Is the header and footer eating into my existing margin spaces? I would like to know what is going wrong and what I can tweak to set the below: Page widths Margin widths Header Footer Text area My header override function is as below: public partial class Header : PdfPageEventHelper { public override void OnStartPage(PdfWriter writer, Document doc) {

How to control print font size

六眼飞鱼酱① 提交于 2020-01-13 09:02:16
问题 I am allowing my users to print but the output is way too large (I have to manually adjust to about 60% in the print dialog). I use a css media query (below) to control the content and have tried changing the font-size of the html, body{} without any change to the output font size. Printing to Adobe PDF prints correctly Any ideas what I am doing wrong? My Print Link: <a href="#" onclick="window.print(); return false;"></a> My css: @media print { body * { visibility: hidden; } .printme,

Print not working when compiled with py2exe

不羁的心 提交于 2020-01-13 08:43:11
问题 this is my very simple code, printing argvs: import sys argv=sys.argv for each in sys.argv: print each here's the output when ran: e:\python>python test1.py 1 2 3 4 5 test1.py 1 2 3 4 5 I want it to be compiled, so I made one with py2exe: e:\python>python setup.py py2exe and my setup.py: from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 3}}, windows = [{'script': "test1.py"}], zipfile = None, ) and I don't get any