Printing on non-standard page size

Hi
I'm developing a class that prints a single page tiff on plotter. The page size is not standard. In most cases it is as wide as an A0 or as an A3 but the height has to be computed depending on the size of the image.
First question: how can I get the height in 72nds of an inch from a RenderedImage that contains the tiff? All I can get is its size in pixels, but I cannot get the resolution...
Second question: I tried to set the paper size in the pageformat with a new instance of Paper and also the imageableArea, but some part of the image are not printed and the image is deformed.
Have you got any suggestion?
Here's the piece of my class that actually prints. If you need, I can post the entire class
class PrintTif implements Printable {
public int print(Graphics g, PageFormat f, int pageIndex) {
      if (pageIndex >= 1) {
        return Printable.NO_SUCH_PAGE;
      if (renderedImage != null) {
              //  Converts the image size in 72nd of inch
              //  supposing it has 200x200 dpi (it is so, but I don't know why)
              double w = (double) renderedImage.getWidth() / 200.0 * 72.0;
              double h = (double) renderedImage.getHeight() / 200.0 * 72.0;
              // Set the papersize and the imageableArea at the sime size
              Paper paper = new Paper();
              paper.setSize(w, h);
              paper.setImageableArea(0,0,w,h);
              f.setPaper(paper);
              f.setOrientation(w > h ? PageFormat.LANDSCAPE :
                               PageFormat.PORTRAIT);
        // convert to a BufferedImage since I cannot write a RenderedImage for some reason
        BufferedImage good = new BufferedImage(
              renderedImage.getWidth(), renderedImage.getHeight(),
              BufferedImage.TYPE_BYTE_GRAY);
        Graphics2D g2dtemp = (Graphics2D) good.getGraphics();
        g2dtemp.drawRenderedImage(renderedImage, new AffineTransform());
        Graphics2D g2d = (Graphics2D) g;
        g2d.translate(f.getImageableX(), f.getImageableY());
        g2d.drawImage(good, 0, 0 , (int) f.getImageableWidth(),
                      (int) f.getImageableHeight(), 0, 0,
                      renderedImage.getWidth(),
                      renderedImage.getHeight(), null);
        return Printable.PAGE_EXISTS;
      else {
        return Printable.NO_SUCH_PAGE;
}

Hi,
According to the printers paper handling specifications, it's not able to handle A4 card.
"Although I work for HP, I'm speaking for myself and not on behalf of HP"
"Say "Thanks" by clicking the Kudos Star in the post that helped you.
--Please mark the post that solves your problem as "Accepted Solution"

Similar Messages

  • Minor screen drawing anomaly with non-standard page sizes in outline mode.

    When I use a page size of 5.5 x 8.5, and the window is larger than the page, the right edge of the page is drawn incorrectly. Instead of a small shadow at the right edge, there are black blotches. As far as I can tell, this only occurs in outline mode, only on the first page, only in sizes other than 8.5 x 11.
    Not a big deal, clearly, but someone ought to log it. Some memory somewhere is not getting written correction. This is easily reproducible.
    I'll post a screen shot somewhere if anyone wants to pursue this.

    It is fun to explore this question and I have tried to reproduce the problem, but my Pages09 behaves with "all" different page setups like A4, US Letter, half US Letter , US Legal. It would be nice to see the screen shots if it isn't to much trouble.
    Question - have updated iWorks with the update that came a while ago??

  • Printing to PDF (custom page size) from AutoCAD Won't Work Anymore

    The DWG to PDF driver provided with AutoCAD 2013 will not save my artwork to a high enough resolution for me to use.  See attached screen shots of the PDF's printed by AutoCAD's DWG to PDF driver.
    The only PDF print driver that I have found that will is the Adobe PDF driver provided with my Adobe Acrobat 9 Pro software.  See attached screen shot of the PDF printed by the Adobe PDF driver.  HOWEVER, I can only print to a standard paper size and I MUST print to a custom page size.  When I try printing to a custom page size it will no longer let me save the PDF.  It simply skips the save window.  It used to work fine up until this past week, but when I came into work on Monday morning it stopped working.  I cannot for the life of me figure out why it won't work now!
    DWG to PDF set to Maximum Quality (400 DPI)
    DWG to PDF set to Custom 1200DPI
    Adobe PDF set to Custom 4000DPI

    Try opening the DWG file in AutoCAD 2013 and changing its file format to an older version of Autocad (i.e, 2010/2011/2012).

  • AV output and non-standard frame sizes

    I usually work in non-standard frame size for my FCP projects because my final output will be in a 2:35:1 ratio. I use a Blackmagic Ultrastudio Mini Monitor as an HDMI output to a client monitor. Up until a few months ago the AV output of FCPX would allow the Mini Monitor to accept a frame size of 1920x818 and letterbox the output to 16x9 on this consumer grade LCD. One day, this just stopped working... I've reached out to Blackmagic and they have no solution or reason why this happened, and are not willing to offer support since what I was achieving wasn't an "officially supported" feature. Now, the AV output will distort the image vertically to fill a 16x9 frame. At this point I am stuck having to use either a matte layer or a widescreen effect on individual clips to output correctly to my monitor which increases edit time having to re-render any edits underneath the matte and having to re-order the letterbox effect after apply color correction etc. It was also very easy to adjust the frame offset with this wide angle project size.
    Is anyone editing in 2:35:1 (or other cinema standard) projects and getting successful conversion on output? What are you using?
    Cheers,
    Matt

    Thanks Tom, you clarified it .......  or at least something clicked in my brain.
    I was trying to set "Custom" when I created the new project.
    I didn't know, or had forgotten, that in the "error" window I could select "Custom".
    All is now well and FCP X 10.1.1 is pretty clever after all!
    There is one weird thing I'd like to mention.
    When I clicked on "Custom" the 960 x 600  frame dimensions appeared but the  frame rate was listed as 23.98p as shown in the screenshot below.
    So what's wrong with that?
    Well the clip is 30p  and I naturally thought I was going to end up with a project with an incorrect frame rate.
    Now here's the funny thing  .........  when I selected the project and viewed it in the Inspector it was the correct 30p
    So why was I given that worrying piece of misinformation.

  • I thought FCP X 10.1.1 could handle non-standard frame sizes?

    Yesterday I was demonstrating FCP X 10.1.1 to a friend.
    As time was limited I imported the nearest piece of video I could find, which happened to be part of an H.264  video tutorial with a frame size of  960 x 600 and a frame rate of 30fps.
    I hit the E key to send it to the timeline only to receive the old "not recognised" error message as shown below.
    I thought I may have created the project incorrectly but when I repeated with a new project I double-checked that I had selected "Set based on first video clip".
    I thought that FCP X 10.1.1 would automatically recognise a non-standard frame size and simply create an appropriate project.
    I was too busy doing the demo to investigate at the time but later I discovered that there was no problem creating a 960 x 600 custom project manually.
    It's a pity FCPX is not clever enough to do it automatically  ............  or can it?

    Thanks Tom, you clarified it .......  or at least something clicked in my brain.
    I was trying to set "Custom" when I created the new project.
    I didn't know, or had forgotten, that in the "error" window I could select "Custom".
    All is now well and FCP X 10.1.1 is pretty clever after all!
    There is one weird thing I'd like to mention.
    When I clicked on "Custom" the 960 x 600  frame dimensions appeared but the  frame rate was listed as 23.98p as shown in the screenshot below.
    So what's wrong with that?
    Well the clip is 30p  and I naturally thought I was going to end up with a project with an incorrect frame rate.
    Now here's the funny thing  .........  when I selected the project and viewed it in the Inspector it was the correct 30p
    So why was I given that worrying piece of misinformation.

  • When printing from file, print or print preview, must set page size @ 40% to get correct printing. IE is ok only wrong on firefox!

    when printing from file, print or print preview, must set page size @ 40% to get correct printing. IE is ok only wrong on firefox! edit

    What happens when you select a scale higher than 40%?

  • MFP M177FW non standard paper sizes

    hi all
    i'm using libreoffice on both windows and linux (mint ubuntu and debian testing) and sometimes i have to print on very non standard sizes: 102 * 333 mm
    it's a huge pain to decently print on such a paper: is there an easy workaround, especially for linux?
    yesterday i've noticed that after some 50 prints on such a format, printer would stop before each print for cooling down, even if it didn't work or has been off for minutes: is it normal?
    thank you
    This question was solved.
    View Solution.

    Hi @Carlo85 ,
    I see that you would like a easier method for printing custom sizes and the printer keeps going into cool down mode.
    I can help you.
    I have provided a document with the error code message you are getting.
    Resolving Control Panel Messages.
    You can create a custom form within the print driver.
    Create Custom Paper Sizes in Windows 7, Windows 8, and Mac OS X.
    Sorry I don't have any documentation for Linux. You would have to contact them for further support.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Page size printing problems with custom page size I created

    I have created a custom page size (very small) for printing an advertise I had to print, and now after that operation all the pages I ask to print to any printer are automatically printed in that setup, and sometimes even if I change to A4 manually, the page changes but the borders of the page still remain the old one (result i can not print). How can I cancel the custom page size I created, so that my printers restart to print automatically in A4?
    thank you very much

    I have created a custom page size (very small) for printing an advertise I had to print, and now after that operation all the pages I ask to print to any printer are automatically printed in that setup, and sometimes even if I change to A4 manually, the page changes but the borders of the page still remain the old one (result i can not print). How can I cancel the custom page size I created, so that my printers restart to print automatically in A4?
    thank you very much

  • Editing non standard video sizes

    Hello everyone.
    I have a load of video which is 1120 x 593 its basically screen capture video from my PC in mov format.  All i want to do is edit these clips together and add some nice effects.  So anyway i toddled off and bought a copy of of premier elements and started movie making!
    Anyway i can't seem to figure out how to retain the size of my video as ive got to use a project template, which is great if you are using video from a device but my video is a non standard size.  Surely there is a way of doing this? 
    Do i have to make sure that my imput video matches one of the template, surely not?  You must be able somehow to do your own size?
    Thanks

    Thank you for replying.
    Basically I like to fly x-plane flight simulator which gives you the ability to record your flying and outputs the video as a high quality mov. I wanted to use premier elements just to make a movie of different clips and just add a few effects and titles  I was just going to output them as fla to watch on my pc or the web.  Or as Mpeg 4 to put into powerpoints
    I tried using some of the presets but the quality is either awful or i get the black border.
    I seems that only the profesional edition allows you to set the frame to desktop and use a custom size.   I just can't believe that you need to spend £500 on the CS5 edition to do this? I'm not wanting to do anything clever here, just change the video size.
    Ive got a sinking feeling ive just wasted £75.

  • Printing Postscript from Multiple page sizes

    I'm working at a screen shop, printing .ps files for film. Most of the art is provided from the client on seperate artboards of varying size. In the print dialog box I select "custom" from media size options. This sets my page size to the size of the selected artboard. The problem is each page needs to be a different size so I am forced to print each page one at a time. Is there a way for illustrator to change the media size per artboard? Is there a work around?

    Probably something that could be done with a script...
    Mylenium

  • Is it possible to print non-standard photo sizes?

    hello-
    i searched the forums but could not find anything related to my question. thanks in advance for any advice you have.
    i want to print a photo that is an odd size 6x10 for use in a scrapbook. this is my first time printing a photo that is not a standard size and i have been unable to find how to do this.
    i have tried to set a custom paper size in "Page Setup" (hoping to "trick" it into doing it). However, the custom size does not show up in iPhoto.
    I am editing to add that I am printing at home on a Canon Pixma iP6000D.
    Please help!
    Thanks,
    Vanessa

    Vanessa:
    Welcome to the Apple Discussions. You can't do it with iPhoto. You'll need a 3rd party application. Give Seashore a try. It is a freeware application. You can crop and resize in Seashore to print any sized image you want. For more advanced editors you might consider GraphicConverter or Photoshop Elements. PSE is capable of some very advanced editing.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    MBP 2.16Ghz; G5 Dual Core 2GHz, 2G RAM ea, 250G HD; G4 Dual 1Ghz, 1.5G RAM;   Mac OS X (10.4.10)   22" LCD, 710G FW HDs, Canon: SD700IS/i850/LIDE 50, Epson R200, 30G iPod, 2G Nano

  • Print Booklet reporting different page sizes

    I recently had to reload InDesign CS6 and now on my 16 page booklet I get an error that says the pages are different sizes and it cannot print in "print booklet".  Only after I reloaded the program did I start having this problem. I have been using this booklet template for months. I can save to PDF but prefer to print from InDesign.

    I got your file, and I have bad news and good news. We'll start with the bad news.
    It does the same thing here. I tried export to .idml, resizing all the pages withthe page tool, and moving the pages into a new file, all without success. My conclusion is there's a page that's corrupt and thinks it's a size that it is not. I looked at the file history, and I see it began life in CS5.5, crashed at least twice and was recovered and went from being edited in version 7.5.0 to 7.5.2 and then back to 7.5.0 before being opened and converted in CS6. My suspicion is that you recycle this file month after month by deleting the stuff that no longer applies, then adding new stuff in. Working that way, over time, small errors can creep into a file, none of which might be enough to cause a problem on its own, but taken together they create a disaster. Version 7.5.0 was buggy, too, so that may not have helped, either.
    With a document like this, where a lot of the content is the same over a long period I recommend creating a "shell" document with the things that repeat, your styles, and any swatches you use, then save it as a template file (.indt). For each new version you open the template, whcih gives you a fresh copy. If there is somthing from the previous version that should be reuded, copy and paste from the older version into the new one, or place it again. This workflow greatly reduces the chances of cumulative file damage.
    Now for the good news.
    While moving the pages to a new document was not successful, going spread by spread, selecting all, copying, then pasting in place in a new doc did work.

  • Printing to Larege Architectural Pages Sizes

    I have seen some discussion regarding the disappearance of the default Arch size defaults.  My issue is printing from Adobe to Arch D on HP plotter, and therefore to scale. This was available on earlier versions, and now only ANSI sizes are available, makes no sense please help.

    I am using X Pro.  It just upgraded as well to a new interface, but the problem existed before.  Creating all the sizes when they were available in the previous versions just seems so unproductive.  I have also read that Adobe grabs from the printer driver, however, when I print to adobe from Autocad, they all exist, however not when I print from Adobe to the plotter.  I have tried to import the .pdf  to Autocad and then plot but the file becomes huge and crashes the HP800....go figure. 

  • How to print selected non-adjacent pages?

    I need to print out a few hundred pages using both sides of the paper (as my printer doesn't do 2-sided). Before, in Word for Mac, I could print a large range of discontinuous uneven pages all at once (selecting a range of 1, 3, 5, etc).-- and simply turn the pile of pages to print out the evens (2,4,6 etc). Very frustrated now since "upgrading" to Lion 10.7.2. as it means not only that hundreds of my Word for Mac documents are unreadable, but also that I can't print large ranges og discontinuous pages in Pages. PLease help -- I'll go crazy -- and wear out my printer drawer -- if I have to manually turn each and every page...for hundreds and hundreds of pages....

    Even if you don't have two sided printing, check to see if you don't have a manuel setting for it.
    Or, you could print all odd pages, then even:

  • Trouble exporting non-standard frame size

    So I have to deliver a Quicktime that's 210w x 190h that will eventually be compressed for web posting. The source footage is DV/NTSC (720x480). I cut my initial sequence at those specs and then nested that into a 210x190 sequence and resized the nest to fit, maintaining aspect ratio (i.e. sides were cropped). But whenever I export to QT, the frame size is stretched horizontally when viewed on a computer monitor. I've tried exporting that sequence "with current settings", set the sequence to square pixels, exported as Animation or "none", exported using Compressor with every conceivable combination....all to no avail. They all spit out the same problem.
    Am I missing something?

    Thanks Tom, you clarified it .......  or at least something clicked in my brain.
    I was trying to set "Custom" when I created the new project.
    I didn't know, or had forgotten, that in the "error" window I could select "Custom".
    All is now well and FCP X 10.1.1 is pretty clever after all!
    There is one weird thing I'd like to mention.
    When I clicked on "Custom" the 960 x 600  frame dimensions appeared but the  frame rate was listed as 23.98p as shown in the screenshot below.
    So what's wrong with that?
    Well the clip is 30p  and I naturally thought I was going to end up with a project with an incorrect frame rate.
    Now here's the funny thing  .........  when I selected the project and viewed it in the Inspector it was the correct 30p
    So why was I given that worrying piece of misinformation.

Maybe you are looking for

  • How can I restore my new iMac back to when I first switched it on?

    I was so keen to get my new iMac working that I got my name wrong in the setup and I stupidly skipped the migrate settings step which would have taken everything over from my old Mac. How can I get back to how things were when I first switched on so

  • Strange/unusual behaviour of New-ish(Old white style) Macbook

    I got my Macbook the same week the new ones came out, so its not very old. Since day 1, sometimes when i turn it on the green light from the built in camera comes on, and wont go off until shut down. This then makes photobooth and any application tha

  • Can I extract photos from a slideshow?

    I was given a slideshow someone made. It is identified as VIDEO_TS.VOB and opens in VLC. It won't play in Quicktime. Anyway, is there a way of extracting the original photos from the slideshow? Thanks for any help you might be able to give.

  • Want to get the Last 4 numbers of the Class number  of Material   !!Urgent!

    Hi all, I am having a BAPI called BAPI_OBJCL_GETCLASSES to get CLASS NUMBER FOR MATERIAL. In that I am getting the Class number for the Material. But in that matetial  I want to get only the last 4 numbers of the Class number, Can any one tell me is

  • Itunes 11.0.03

    several tv shows that I purchased and watched are now garbled and I can't watch them any longer on my laptop (Macbook Pro).  The interesting thing is that I can still watch the same shows on my iPad.  Does anyone have any suggestions?  Can I download