• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 834
  • Last Modified:

How to programmatically set (Page Setup on Internet Explorer & Mozilla)

I have a software that performs tasks like ENVOICES, PAYABLES, RECEIVABLES, etc. The thing is that the envoices have a format for POS systems. With my EPSON TM-U220 set as default, it shows the content of the envoice, but when I print it, the margins don't fit on the width of the paper (40 columnas)

The thing is that if I manually set the margins (Left=0 / right= 0) it then prints fine. If I for example needed to print a report, I would have to set another page setup in order for the report to fit the page.

What I want to avoid is to manually having to set PAGE, and be able to either print a report or an envoice without having to worry about these things. It would be helpful if I could SET a PAGE format for a URL individually. The thing is that I don't know if this can be achieved with any browser.
0
aguisa
Asked:
aguisa
  • 4
  • 3
1 Solution
 
Jason C. LevineNo oneCommented:
Hi aquisa,

There are two ways to approach this problem.

You can try to set a print-only stylesheet and define margins and container widths there.  Some trial and error will be needed to produce the correct effect.  The other method would be to generate the invoices, etc. as PDF directly on the server and set the margins and paper size in the PDF generation script.  That would only have to be done correctly one time and then the system would generate what you need, display it in the browser and you can dump it to the printer from there.
0
 
aguisaAuthor Commented:
Lets say I go for the CSS approach. Is there any example that you might bring in order to produce this effect?
0
 
Jason C. LevineNo oneCommented:
How big is 40 columns in another measurement?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
aguisaAuthor Commented:
What I need to achieve is the printer to print in FontA11, which is embedded in the printer, and has a fixed width. The printer is an EPSON TM-U220, those which are used in Points of Sales.

thanks for your interest
0
 
Jason C. LevineNo oneCommented:
So here is a sample CSS file that sets zero margins and a hard width:

@charset "utf-8";
/* CSS Document */

body, html {
      margin: 0;
      padding: 0;
}

#container {
      width: 5in;
}
      
0
 
aguisaAuthor Commented:
It looks pretty easy and seems to be functional. I will give it a try and let you know. Thanks.
0
 
aguisaAuthor Commented:
it sure worked fine. Thanks a lot
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now