Thread: scan an image and print it

  1. #16
    Registered User
    Join Date
    Sep 2006
    Posts
    10
    Quote Originally Posted by Salem
    Since postscript files are just text files, you can
    a) look at them with a text editor (check that they begin with %!PS IIRC)
    b) read said text file into your own program, so you can merge your data with the already encoded bitmap data.
    c) squirt the whole lot out to the printer.

    Reading image.ps is no different to reading image.bmp, it's still an external file.
    If you want to hide the conversion inside your program, then that's doable as well.

    No doubt you could get the source code for bmp2ps and just incorporate that directly into your code.

    I've no idea what you did, but this seems to indicate that your printer might not understand postscript.
    http://en.wikipedia.org/wiki/HP_LaserJet_4
    Any particular kind of garbage - like for instance the same as what you see when you view the poststript file or was it a different kind of garbage.
    on the hplaserjet 4plus printer, it pretty much regurjitates what you see in the file. So i guess it doesnt understand ps.

    I tried an hplaserjet 4000 and had slightly better luck with that. It printed the graphic but for some reason it placed it to the bottom of the page and enlarged it to fit the page. Is there a way to control the size and location of the graphic on the page?

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > Is there a way to control the size and location of the graphic on the page?
    Quite probably.

    The tool has a number of command line arguments IIRC - I'm sure you could convince it to do what you want.

    If all else fails, you have the option of manually (or in your program) adjusting the postscript file itself to make it do what you want, once you've learnt a little bit about the postscript language. Try fiddling with some scale and translate parameters which are probably in the .ps file.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #18
    Registered User
    Join Date
    Sep 2006
    Posts
    10
    Quote Originally Posted by Salem
    > Is there a way to control the size and location of the graphic on the page?
    Quite probably.

    The tool has a number of command line arguments IIRC - I'm sure you could convince it to do what you want.

    If all else fails, you have the option of manually (or in your program) adjusting the postscript file itself to make it do what you want, once you've learnt a little bit about the postscript language. Try fiddling with some scale and translate parameters which are probably in the .ps file.
    do you know ofhand how to end the ps (so that the printer knows that its is no longer PS and is in fact regular text thant is to be printed literaly)
    BTW thanks alot for your help!

  4. #19
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    Not off hand, but since .ps understands how to position text, along with fonts and sizes why not make use of it while you can?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointers trouble
    By saahmed in forum C Programming
    Replies: 39
    Last Post: 03-24-2006, 04:08 AM
  2. a 2-D array image (Prompt)
    By amirahasanen1 in forum C++ Programming
    Replies: 6
    Last Post: 09-26-2005, 03:59 PM
  3. HELP !! .. print a "box" problem
    By imbecile in C in forum C Programming
    Replies: 6
    Last Post: 07-26-2003, 01:54 PM
  4. Image Thinning
    By Colin in forum C++ Programming
    Replies: 3
    Last Post: 02-10-2003, 10:38 AM
  5. Still can't print a Histogram from fail input
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 07-11-2002, 12:24 PM