Closed youanden closed 8 years ago
@rogerwang I hope this will be defaulted or we have more control on page margins in next release.
@youanden Hi, I think for now you can use PDFKit and make a hidden Window to print a PDF. You can trigger PDFKit to autoprint with this code:
var ref = doc.ref({
Type: 'Action',
S: 'Named',
N: 'Print'
});
doc._root.data.OpenAction = ref;
Note: Client must have Adobe Reader installed.
Other solution is to have a process say "FoxIt PDF Reader" to silently print the pdf file. Until then, I hope this is going to be corrected.
For a Use Case, as @rogerwang would always require is:
As if I am creating a page/div of 8.5in x 11in
and with a UI of Drag & Drop UI elements with a background of a 96dpi
scanned document as a guide for a pre-printed document, so x & y pixels will be converted in points/inc the process (upon cloning). And to print this, is just to clone the </div>
w/o the background to another window and print that.
Best Regards!
Thank you very much, Kevinralph! I've already set up the perfect layout and margins using PDFKit, I didn't know about silent printing but I'll definitely try to implement it to print automatically if possible since now it just opens the generated PDF in the default program.
My actual use case is quite simple, however. My program scans data from connected devices and generates a label. The label prints on a label printer which has a limited amount of room (2.3in x 3.9in)
, and the default margins prevent me from putting all of my already squished content within the printing bounds.
Thanks again!
This should be working with latest version now.
In 0.13 we changed to an optimized architecture so more features can be supported, see http://nwjs.io/blog/whats-new-in-0.13/ and it's good for keeping up with Chromium upstream -- we released with Node.js v6.0 and new Chromium versions within 1 day after upstream release.
The new version would fixed many issues reported here and we're scrubbing them. This issue is closed as we believe it should be fixed. Please leave a message if it isn't and we'll reopen it.
Basically, assuming I were to create a file with css set zeroing all margins with some text, the content when printed or previewed as a PDF (on OS X) will yield 1 inch margins.
I found this person on Stackoverflow attempt to resolve this issue, but after looking at the 14GB source download required to compile, I'm not confident I will be able to compile something like that in a timely manner.
I was wondering if there is another way to accomplish that.
I am aware that it is possible for me to generate a PDF and open the file in the default pdf viewer, but this is an extra step that I'd rather not program until I am aware of any alternatives.
Thank you for the assistance.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.