Your boss comes at your desk with a pile of CDs filled with high quality tiff images(roughly 20000 x 20000 pixels)
He tells you to print all the image files fit into a "letter" sized paper in 2 days
Well, that sort of stuff happend to me...
Man, was I frusted...
But that's when MSH came into rescue~
Well, the first thing that came up in my head was, "out-printer" cmdlet.
So I tried the following
Voila. Now i was excited to see a picture in PDF format through "out-printer".
Wrong!
All I saw in the generated PDF file was
, which is data you see just typing "MSH>$bitmap" in console.
Gosh, was I frusted, again. I looked into "out-printer" help page if there was some kind of "-encoding" option to print binary files(images) but there wans't any...
I resorted to using System.Drawing.Printing.PrintDocument
Well, using that Class, printing is an image is a breezy job
So i created a cmdlet called "print-image" which takes an image name and print it
Here is the usage of the cmdlet
The cmdlet takes the mandatory parameter "image name" with optional printer to print to and whether image size should fit on a paper
Following is how the cmdlet can be used
Well and that's exactly what i did... :)
Oh yeah, I would appreciate it if anyone can tell me how i can format the code to fit on to the site :)
Tags : Monadmsh
He tells you to print all the image files fit into a "letter" sized paper in 2 days
Well, that sort of stuff happend to me...
Man, was I frusted...
But that's when MSH came into rescue~
Well, the first thing that came up in my head was, "out-printer" cmdlet.
So I tried the following
MSH>$bitmap = new-object System.Drawing.Bitmap c:\test.tif
MSH>out-printer -printer "Adobe PDF" -in $bitmap
Voila. Now i was excited to see a picture in PDF format through "out-printer".
Wrong!
All I saw in the generated PDF file was
Tag :
PhysicalDimension : {Width=14454, Height=21957}
Size : {Width=14454, Height=21957}
Width : 14454
Height : 21957
HorizontalResolution : 1016
VerticalResolution : 1016
Flags : 77888
RawFormat : [ImageFormat: b96b3cb1-0728-11d3-9d7b-0000f81ef32e]
PixelFormat : Format1bppIndexed
Palette : System.Drawing.Imaging.ColorPalette
FrameDimensionsList : {7462dc86-6180-4c7e-8e3f-ee7333a7a483}
PropertyIdList : {256, 257, 258, 259, 262, 270, 273, 277, 278, 279, 282, 283, 32781}
PropertyItems : {256, 257, 258, 259, 262, 270, 273, 277, 278, 279, 282, 283, 32781}
, which is data you see just typing "MSH>$bitmap" in console.
Gosh, was I frusted, again. I looked into "out-printer" help page if there was some kind of "-encoding" option to print binary files(images) but there wans't any...
I resorted to using System.Drawing.Printing.PrintDocument
Well, using that Class, printing is an image is a breezy job
So i created a cmdlet called "print-image" which takes an image name and print it
Here is the usage of the cmdlet
print-image "image name" [printer name] [fit image to paper]
The cmdlet takes the mandatory parameter "image name" with optional printer to print to and whether image size should fit on a paper
Following is how the cmdlet can be used
MSH> ls *.tif | foreach { print-image $_ }
Well and that's exactly what i did... :)
function print-image { |
Oh yeah, I would appreciate it if anyone can tell me how i can format the code to fit on to the site :)
Tags : Monadmsh