Share via


Need pixel width for paper sizes A4, A5, Executive, Letter, Legal, Executive

Question

Friday, June 26, 2009 11:40 AM

Iam using System.Windows.Forms.WebBrowser control in my application. To indicate the user of the paper size I need to know the pixel width of the following paper sizes:

A4, A5, Executive, Letter, Legal, Executive.

Thanks,Satish.J

All replies (6)

Friday, June 26, 2009 12:23 PM ✅Answered

I don't know it off the top of my head, but you can just google for the sizes of the various paper types (in inches) and multiply by the DPI to get the size in pixels.


Friday, June 26, 2009 1:30 PM ✅Answered | 2 votes

A4 := 210 mm × 297 mm
A5 := 148 mm × 210 mm
Executive := 7.25 inches × 10.5 inches
Letter := 8.5 inches x 11 inches
Legal := 8.5 inches x 14 inches

so at 200 dpi:

A4 = 1654 pixels x 2339 pixels
A5 = 1165 pixels x 1654 pixels
Executive = 1450 pixels x 2100 px
Letter = 1700 pixels x 2200 pixels
Legal = 1700 pixels x 2800 pixels

fyi: you can get paper sizes on wikipedia
fyi: you can use Google to do unit conversions for you for weird things like "dots" by substituting "units" like this:  297 mm * 200 units per inch


Friday, June 26, 2009 8:10 PM ✅Answered

private void button1_Click(object sender, EventArgs e)
    {
      {
        using (PrintDocument PD = new PrintDocument())
        {
          foreach (PaperSize P in PD.PrinterSettings.PaperSizes)
          {
            Console.Write(P.PaperName + " ");
            double W = P.Width / 100.0;
            double H = P.Height / 100.0;
            double[] M = { 1, 72, 200 };
            for (int I = 0; I <= 2; I++)
            {
              Console.Write((W * M[I]).ToString() + " " + (H * M[I]).ToString() + " ");
            }
            Console.WriteLine();
          }
        }
      }
    }
Letter 8.5 11 612 792 1700 2200 
Legal 8.5 14 612 1008 1700 2800 
Executive 7.25 10.5 522 756 1450 2100 
A4 8.27 11.69 595.44 841.68 1654 2338 
A5 5.83 8.27 419.76 595.44 1166 1654 
B5 (JIS) 7.17 10.12 516.24 728.64 1434 2024 
Envelope #10 4.12 9.5 296.64 684 824 1900 
Envelope DL 4.33 8.66 311.76 623.52 866 1732 
Envelope C6 4.49 6.38 323.28 459.36 898 1276 
A6 4.13 5.83 297.36 419.76 826 1166 
Borderless photo 5x7in. 5 7 360 504 1000 1400 
Borderless 4x6in. 4 6 288 432 800 1200 
Borderless 4x6in. (tab) 4 6 288 432 800 1200 
Index Card (3x5) 3 5 216 360 600 1000 
Index Card (4x6) 4 6 288 432 800 1200 
Index Card (5x8) 5 8 360 576 1000 1600 
Hagaki card 100x148mm 3.94 5.83 283.68 419.76 788 1166 
Borderless 8.5x11in. 8.5 11 612 792 1700 2200 
Borderless photo A4 210x297mm 8.27 11.69 595.44 841.68 1654 2338 
Borderless photo A6 4.13 5.85 297.36 421.2 826 1170 
Borderless hagaki 100x148mm 3.94 5.83 283.68 419.76 788 1166 
A2 envelope 111x146mm 4.37 5.75 314.64 414 874 1150 
4x6in. 4 6 288 432 800 1200 
4x6in. (tab) 4 6 288 432 800 1200 
5x7in. 5 7 360 504 1000 1400 
Panorama 4x10in. 4 10 288 720 800 2000 
Panorama 4x11in. 4 11 288 792 800 2200 
Panorama 4x12in. 4 12 288 864 800 2400 
Panorama 10x30cm 4 12 288 864 800 2400 
Panorama, A4 8.27 23.39 595.44 1684.08 1654 4678 
Borderless Panorama 4x10 in. 4.23 10.14 304.56 730.08 846 2028 
Borderless panorama 4x11in. 4.23 11.14 304.56 802.08 846 2228 
Borderless Panorama 4x12 in. 4.23 12.14 304.56 874.08 846 2428 
Borderless panorama 10x30cm 4.22 12.14 303.84 874.08 844 2428 
Borderless panorama A4 8.5 23.53 612 1694.16 1700 4706 
10x15cm 3.94 5.98 283.68 430.56 788 1196 
10x15cm (tab) 3.93 5.97 282.96 429.84 786 1194 
Borderless photo 10x15cm 4.23 6.19 304.56 445.68 846 1238 
Borderless photo 10x15cm (tab) 4.24 6.19 305.28 445.68 848 1238 
Borderless photo A5 148x210mm 6.06 8.41 436.32 605.52 1212 1682 
Borderless photo B5 182x257mm 7.41 10.26 533.52 738.72 1482 2052 
8x10in. 8 10 576 720 1600 2000 
13x18cm 5 7 360 504 1000 1400 
Borderless photo 13x18cm 4.42 7.13 318.24 513.36 884 1426 
Envelope A2 4.38 5.75 315.36 414 876 1150 

Friday, June 26, 2009 11:54 AM

Well that's going to depend on the DPI settings for the printer at the time that you print the document. And the user can change that at print time...


Friday, June 26, 2009 12:17 PM

I forgot to mention the DPI of the printer. Please let me know the pixel width for the paper sizes 'A4, A5, Executive, Letter, Legal and Executive' for 72 and 200 DPI's

Thanks,

Satish.J


Friday, June 26, 2009 12:39 PM

Thanks Matthew!Satish.J