Results 1 to 5 of 5

Thread: Get dimensions from paper kind???

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Get dimensions from paper kind???

    There seems to be no reliable way to get paper dimensions from the paper kind ... I have looked for about an hour online ... but all methods seem to use either the PrinterSettings or PrintDocument. The problem with using these is that they will only work for page sizes that your printer supports!

    ... so unless you have an A1 printer ... you won't be able to work out the paper dimensions by using this method..

    Is there a better way?...

    I noticed that there was a private method in the built in paper size (look here under "private Point Dimensions")
    ... but I tried to call it using reflection and it seems to be removed in the later versions of .net altogether (not surprising since Microsofts comment is: "I don't think we need this anymore")
    How crazy is this WE NEED THIS!

    Any ideas?

    Thanks in advance,
    Kris

  2. #2
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Get dimensions from paper kind???

    I hard coded them.

  3. #3
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Get dimensions from paper kind???

    Why not copy-paste the Select Case statement from the code you linked to? I'm sure it's more comprehensive than anything that would have been built into the Framework.

    I suppose it's inevitable that the Framework avoids cluttering itself up with "external" information: not because of the space, but because of the implicit need to keep it up to date. After all, it doesn't even contain an enumeration of Windows Messages, does it.

    BB

  4. #4
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Get dimensions from paper kind???

    I think the constants are in the PrintJob.vb code

  5. #5

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Re: Get dimensions from paper kind???

    Quote Originally Posted by boops boops View Post
    Why not copy-paste the Select Case statement from the code you linked to? I'm sure it's more comprehensive than anything that would have been built into the Framework.

    I suppose it's inevitable that the Framework avoids cluttering itself up with "external" information: not because of the space, but because of the implicit need to keep it up to date. After all, it doesn't even contain an enumeration of Windows Messages, does it.

    BB
    That's what I ended up doing ... but it still seems like something that should be built in IMHO

    Kris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width