Problem setting page margins for printing

I made a program that prints inventory reports at work, but I wanted to push back the margins a bit so I can use a font size one larger. As it is, some of the information is at font size 10. I do not want to use the "Page Settup" dialog to bug the user to change it; I wanted to set it automatically.
I tried taking the PageFormat argument to Printable's print() method and setting the imageable area like so...
    public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
        Paper formatEdit = pageFormat.getPaper();
        formatEdit.setImageableArea( 36,36, pageFormat.getWidth()-36,pageFormat.getHeight()-36);
        pageFormat.setPaper(formatEdit);
        ...Is this at least the general approach I should be using, or should I be doing something totally different?
As always, thanks much in advance.
Edited by: Loduwijk on Sep 25, 2008 3:40 PM
Edited by: Loduwijk on Sep 25, 2008 3:50 PM

Set them automatically based on what criteria?
If you just want to set them programatically, then as the Help indicates, use the Printing:Margins property to set those values.
Attachments:
Example_VI_BD.png ‏2 KB

Similar Messages

  • Safari won't use custom page margins for printing

    I'm using Safari 4.04 on Snow Leopard. Here's the problem in a nutshell: I'd like to print pages that I can put in a three-hole-punch binder, without the holes going through printed content. In other words, I simply want to set a custom left margin for printing. Should be simple, right? Apparently, not if you use Safari.
    OK, as far as I can tell, here's how it's supposed to work (and this is how it works for me in every browser except Safari):
    In the "Print" dialog box, click the "Paper Size" drop-down menu (which defaults to "US Letter"), and scroll down to "Manage Custom Sizes…". Create a custom paper size with the desired margins. Now you should be able to select this custom paper size when you print.
    This works fine in other browsers (of course you may need to select the custom size from the "Page Setup" menu, but in Safari 4 this is apparently integrated into the "Print" dialog). In Safari, however, the custom margins are completely ignored. A simple, but frustrating, bug …
    This has been a known bug, as I've seen it mentioned in other forums, such as:
    http://forums.macworld.com/index.php?/topic/117342-safari-4-0-3-printing/
    But Apple has yet to fix it.
    OK, for those who are wondering, there are two workarounds I know of, neither of which is totally satisfying:
    1) When setting the custom paper size, define the paper itself as narrower than 8.5 inches; for example set it to 7.5. Safari doesn't ignore the actual paper size, it just ignores the margins you set. But unfortunately this will result in an increase in both left and right margins, not just the left margin.
    2) As I teach Web design, this is the kludge I figured out on my own: Set a user-defined style sheet for Safari. First, create a plain text document consisting of this:
    html {
    margin-left: .5in;
    (Of course, set the margin to your desired width. I'm using a half inch here.) Save this style sheet, calling it something like "safaristyle.css". Now, in Safari's "Advanced"preferences, set this as your custom style sheet. This works great, but unfortunately if you leave Safari on this setting this will result in an increase in the left margin when you view Web pages as well as when you print them. So you can select the custom style sheet only just before printing, and then set it back to "None Selected" when you're not printing.
    Am I the only one who finds it odd that Apple still hasn't fixed this little bug?
    Does anyone out there know of a better workaround? Thanks for listening.

    Set them automatically based on what criteria?
    If you just want to set them programatically, then as the Help indicates, use the Printing:Margins property to set those values.
    Attachments:
    Example_VI_BD.png ‏2 KB

  • Need Help Programmatically setting Page Size for printing to Adobe PDF

    We are upgrading from Adobe 5 to Adobe 9.  In Adobe 5, we set a few parameters in the __pdf.ini file to create a document with a specific Page Size.  For Example:
    [Acrobat PDFWriter]
    PDFFileName=
    bDocInfo=0
    Orient=1
    bExecViewer=0
    cpmarginwhole=18
    cpwidepart=0
    cpwidewhole=612
    cpheightpart=0
    cpheightwhole=792
    Paper=0
    Since upgrading to Adobe 9.2, this no longer appears to work.  I have also tried adding these values to the following Registry Locations with no luck:
    HKCU\Software\Adobe\Acrobat PDFWrite
    and
    HKCU\Software\Adobe\Acrobat Distiller\PrinterJobControl
    Is it still possible to create a custom page size using this method?  Or am I going to have to do that in a different way?

    Bill, thanks for the quick response.  However, we generate many forms on a daily basis with different page size requirements.  The way this was accomplished through Adobe PDFWriter was by setting the various parameters in the __pdf.ini file for the Document that we are generating.  I believe we have about 7 different page sizes that we generate.

  • How to set page margin for any site being viewed without back and forth scrolling?

    Some sites and most forums, the threads cannot be read without scrolling the screen back and forth. How can these be set where all information is read without moving screen short of up or down and not side ways back and forth.

    Thank you all for attempts to satisfy my needs. The last concerning my screen is 19 inches and 800 resolution. I'm very long in the tooth and if I go higher in
    resolution I have to play squint the fonts are so small. Crank them up and I'm back to scrolling back and forth on the screen.
    Again thanks for help but I' m not interested in spending money on newer
    haha state of the art equipment just to satisfy the need of cyber space Ad
    purveyors to post their wares. Graphics I can do without as well. If they want
    me to see what they have to offer, then stop messing with what once worked just fine.
    I still have Word where I can do with whatever I copy n paste to get done what I need. The convenience of doing so right at the site isn't a requirement as such. Being a retired Master Electronics Technician, I'm short on computer orientations but long on other kinds of smarts.
    Again, Thank you all for the help.
    Gizmoman

  • Set custom page size for printing

    I want to set a custom page size for printing some PDF three and four-page musical scores to roll paper on an Epson 1290 using Adobe Reader 9.3.4 on Ubuntu 10.04. The printer properties in the print dialog has a media size option, and one of the choices is "custom", but having chosen "custom", the dialog does not allow me to add the actual page size to the lpr printer command. I can see that when I choose "custom", the lpr command is
    lpr -P Stylus-Photo-1290 -o PageSize=Custom etc
    but what I need for a three page output, for example, is
    lpr -P Stylus-Photo-1290 -o PageSize=Custom.297x630mm etc
    and I can't see how to add the actual custom paper size. If I Ok the media size choice dialog with it just set to PageSize=Custom, I can see from the output preview in the print dialog that the actual page size that has been chosen is letter. The online Adobe doc for Reader 9 printing (http://help.adobe.com/en_US/Reader/9.0/content.html#heading2.3) says "For documents that are larger than the standard page size, go to File  > Page Setup.  Create a custom page size before you print your  document". The problem with that is that there is no "Page Setup" option on the File menu in the Unix version of Adobe Reader, only a "Print" option, which is where I already am.
    If I open the PDFs in Evince, it allows me to add the custom page sizes I want, but as Evince doesn't have the option to print multiple pages per sheet I can't use it either...

    Yes, it used to work, and the resize zoom bar used to work too (now its grayed out). I don't know if this is a "who's to blame for it" thing, but its not getting fixed and its pretty bad that no one seems to care enough even to respond. I found my own solution by opening it in Gimp. Just right click and select open with other ...Gimp and it will import into it. In the Gimp Print dialog, you have a scaling percentage in the "Page Setup" tab, and size settings in the "Image settings" plus loads of other stuff including multiple copies.

  • PIXMA MG8220 default page size for printing is set incorrectly to 6x4, need Letter

    I have a PIXMA MG8220, and the default page size for printing is set incorrectly to 6x4, I need it to be Letter paper size. I'm wasting a lot of paper, and cannot figure how to reset the defaults on the printer vs. individual laptops using the printer?Simon

    Hi simonp, To set the paper size to be printed on, please follow these steps: 1.  Open an application such as TextEdit. 2.  Go up to File and select Print, or press the CMD+P keys on your keyboard. 3.  Locate the PAPER SIZE field, then select the LETTER paper size. 4.  Look for the drop-down menu labeled PRESETS, then expand this menu and choose SAVE AS.
    5.  Type in a name of your choice for this default setting, then click OK.
    You will now be able to select the above created preset from any application you print from, with the default paper size being Letter.  Hope this helps!

  • HELP - setting page margins doesn`t work correctly

    Hi there,
    maybe someone encountered the same Problems I am facing.
    I am setting the page margins for the Left-Side to have enough space to punch the printout.
    Somehow CR seems to ignore the values I set when printing a Report.
    Most of the times I have too much space on the right side and not on the left side.
    The margin on the Left side seems to be the min-margin of the printer.
    What`s wrong with the Reports?
    CR 2008 with SP1 is used.
    The Reports are not designed against a specific Printer.
    The virtual Printerdriver of CR is used.
    Greetz
    Ricardo

    >
    Don Williams wrote:
    > Hi Ricardo,
    >
    > There is a new API that allows you to dissociate the printer... that is by default not checked on in the Report file.
    >
    > Try setting it to true in your app and test again:
    >
    >             // new API added to allow changing printing options
    >             newOpts.DissociatePageSizeAndPrinterPaperSize = true;
    >
    > Search the Object Browser for how to use it.
    >
    > Thank you
    > Don
    Don (or anyone else),
    I try to get to the DissociatePageSizeAndPrinterPaperSize but I can't figure out how to access it.
    I use CR 2008 with Visual Studio 2005, Visual Basic. My goal is to get an unrestricted right hand side
    of my report, so I can have as many columns as I want. (I have a different thread about this).
    First of all: If I search DissociatePageSizeAndPrinterPaperSize in the Object Browser, it can't find it.
    (I have performed an upgrade for CR XI R2 to CR 2008 and it seemingly went well).
    Here is what I do in code (a modified web download for testing):
    Option Strict On
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Partial Class _Default
        Inherits System.Web.UI.Page
        Private rpt As ReportDocument
        Private exportPath As String
        Private myDiskFileDestinationOptions As DiskFileDestinationOptions
        Private myExportOptions As ExportOptions
        Private selectedNoFormat As Boolean = False
        Private Sub ConfigureCrystalReports()
            rpt = New ReportDocument()
            Dim reportPath As String = Server.MapPath("Hierarchical Grouping.rpt")
            rpt.Load(reportPath)
            Dim myPrintOptions As CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions = _
                          CType(rpt.ReportClientDocument.PrintOutputController.GetPrintOptions(), _
                          CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions)
            Dim newPrintOptions As CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions = myPrintOptions.Clone(True)
            Dim newMargins As CrystalDecisions.ReportAppServer.ReportDefModel.PageMargins = newPrintOptions.PageMargins
            newPrintOptions.PageMargins = newMargins
            newMargins.Right = 1000
            'newPrintOptions.PaperSize = CrystalDecisions.ReportAppServer.ReportDefModel.CrPaperSizeEnum.crPaperSizePaperA3
            ' newPrintOptions.PaperOrientation = CrystalDecisions.ReportAppServer.ReportDefModel.CrPaperOrientationEnum.crPaperOrientationLandscape
            rpt.ReportClientDocument.PrintOutputController.ModifyPrintOptions(newPrintOptions)
            myCrystalReportViewer.ReportSource = rpt
        End Sub
    This prints a wider page on-screen than without the code, so it is an improvement. Still, I would like to go
    further, and the DissociatePageSizeAndPrinterPaperSize seems to be promising.
    Can you tell me how to set it in the context above?
    A little observation: When my newMargins.Right gets the value 145, the output is a narrow page.
    When it is set to 146, it jumps to a wider page.
    Setting the PageContentWidth doesn't help any more than the Right option.
    - Kjell Arne

  • Change page margins to print email

    Is there any way to change the page margins when printing emails? When I print out an email, the page margins are a good 1" on top, left and bottom so I have to reduce the type in order to keep simple emails on one sheet of paper.

    I am having the same issue - I have orders coming in by email that I need to print out as order tickets. In the email I have the submissions set to come in as html tables, all of a uniform size. I want to print 4 per page, and can do that by selecting emails, "Print", and then 4 pages per sheet in the print settings and it gives me 4 unique orders on one sheet. But the giant standard margins make it so the submission tables are way too small and I don't want the email header information displayed. This really doesn't seem like too much to ask, I hope it's not really as impossible as all the forums make it seem! BDAqua, you mentioned possibly making a script for this?
    Side note - the order submissions are generated from my form on Jotform. This is a great form builder, at least in my first-time experience, but seems lacking in output options - reports can only be generated as tables, and on the web-based submission viewer the print options are extremely limited as well.
    Any ideas? I'm running 10.9 and I know this is a 10.4 forum, but there's not much on this anywhere else and it doesn't seem like mail has changed much in this regard. Thanks!

  • How to set page margins in Numbers 3

    I just migrated from MS Excel after decades of use. I can't find out how to set page margins using the new Numbers 3 version. I believe I've exhausted all reference materials and the most relevant was an method in Numbers 8 & 9... both of which have a different top menu selection.  The answer is probably right in front of me and simple as it sometimes happens when learning new software...

    Hi caforestfire,
    There is no direct equivalent to page margins in Numbers 3.0. It's more oriented toward sharing on the web and on iPad screens than toward traditional printing.
    However, there are ways to achieve the effect of margins.  The idea is to first position your content (tables, charts, etc) on the canvas of a sheet, using rulers and guides if you want (you can drag the rulers onto the canvas to help in placement):
    Then you File>Print and in Print Preview fiddle with the slider until you get the white space you want around your content:
    Then click Print.
    For many purposes it works quite well. It's just a different approach from what we're used to in Excel, and the old Numbers 2.3.
    SG

  • Seperating 2-page spreads for printing?

    I recently have had trouble with printing my booklets.
    I am using 11x17 documents and wish to seperate 2 page spreads for printing?
    When i currently print it prints the cover page, page 1, seperate but combines the other spreads, with 2 pages per actual printed page.
    I seperate the files one by one for printing currently but i want t0 know if i have to do that, because it wastes valuable time.
    Is it a problem with the way i am exporting the file?
    Please give me your advice as I am open to other ideas to reaching my main goal.

    When you see two pages side-by-side in an InDesign file which is set up with facing pages, that's just how it looks on the screen. If none of the items on your pages span across both pages of a spread, you can output a multi-page PDF, and each page will be independent. In fact, you could have something that crosses the spine on a spread and still output to single pages, but that's not really the point. The double-page part they are talking about is the ability for you to output (for example) pages 2 and 3, which are side-by-side, as a single page that is twice as wide as a normal single page. They also don't want 32 different one-page PDFs for a 32-page book. Neither of these will be a problem if you export your PDF normally. If you see facing pages in the actual PDF, that may be (probably is) just a viewing option. All of the pages will be singles.
    The point I want to make is that you don't have to override the facing pages to make a multi-page PDF.

  • Changing default page margins for Web Intelligence

    Is it possible to change the default page margins for new Web Intelligence documents.  The default size is 76px which most people find exceedingly large.
    The defaultconfig.xml file can be modified to specify default fonts, page size, orientation, etc. Can anything be done to this file to change the default page margins as well?
    Any help would be appreciated ...
    Thanks

    Hi James,
    Following information might be helpful for answering your queries.
    An ER has already been raised for the functionality yo want and the ER# Id is ADAPT01081135
    State
    Submitted
    Origin
    Customer
    Date Entered
    2008-05-23 12:29:54
    Subject
    XIR2: Webi: Wanted to set the default 'Page Layout Margins' to 0px instead of 76px each.
    Current Functionality
    The default 'Page Layout Margins' are set to 76px each for a new Webi report.
    Create a new Webi report - Go to Page Properties - Page layout - By default, Top margin=76px, Bottom margin=76px, Left margin=76px, Right margin=76px.
    Requested Functionality
    Wanted to set the default 'Page Layout Margins' to 0px instead of 76px each.
    Expected Added Value
    There should be an option in Webi / Infoview to set any property value to any required default value. This should be independent of the user, because it may differ from user to user.
    Found In Product
    Business Objects Enterprise.
    Found In Product Version
    XIR2.
    Found In PFA
    Web Intelligence
    B) use SDK kit (this is only a suggestion though)
    https://www.sdn.sap.com/irj/sdn/businessobjects-sdklibrary
    https://boc.sdn.sap.com/codesamples
    You would find almost everything here that BusinessObjects supports (about the SDKu2019s). You could also use the forums to check if anybody have already done what you are looking for)
    Regards,
    Sarbhjeet Kaur

  • Set page title for all pages

    Hi
    Can I set page title for all pages in project, by using filter or something else? Or the only way is to specify the name in each page?
    Michal

    Might be possible with filters, but that would be a rather expensive task. Just create an include file which you include in all pages. This way you also have a single point of maintenance.

  • How can I change the default page setup for printing messages in Apple Mac Version 4.6 (1085)

    How can I change the default page setup for printing messages in Apple Mac Version 4.6 (1085)

    As soon as I posted, Ifigured this one out on my own by going into user settings and changing the default there. Then I was able to delete the default @mac account. Thanks!

  • Printer Driver Problem?  Page margins shift when using paper tray vs. manual feed

    I am printing to an Apple LaserWriter 12/640 PS. The printed page and page margins are PERFECT (WYSIWYG; "What you see is what you get") when printing either to: (a) the MANUAL FEED TRAY of the Apple LaserWriter 12/640 PS; or (b) PDF to view on screen.
    HOWEVER, when printing to the LaserWriter using the (ordinary/usual) paper cassette (you know, the thing that holds the 200+ sheeets of blank paper), two margin problems occur: (1) the uppermost portion of page content is shifted down 3/4" (maybe closer to 11/16") vs. its position on the manually fed paper.  This, in turn, causes the botttom portion of the page content to run off below the printed page.  (2) The "unprintable region" on the right edge of the paper expands from 1/8" with the manually fed paper to 7/16" when using the paper cassette.  This shows up as an extra 5/16" (7/16" - 1/8" = 5/16") of white space/missing page content on the right edge.
    The problem is consistent and reproduceable.  It happens with cassette fed output from Safari, Word 2011, Acrobat X, TurboTax, Quicken Essentials for Mac, and TextEdit.
    BIG problem when printing long documents whose content and margin settings I cannot control (e.g., third-party documents from Acrobat, anything from Quicken Essentials or TurboTax, pages from Safari, etc.).  The only workaround is to feed everything manually (UGGH!).
    I suspect the printer driver is faulty since the problem detailed above happens with so many applications.  Is there a way to edit a plist (using the application/utility "Pref Setter" or similar) to overide the driver's margin settings?
    I believe the print driver is "Apple LaserWriter 12/640 PS v2015.105" (from Sytem Prefences->Print&Scan->Options and Supplies->Driver).
    Any help greatly appreceated.

    Thanks!  It works perfectly!  I even saved my original "oversize" document by printing it to PDF with the scaling so the problem is permanently cured, at least for this document.

  • Setting up Designer Margins for Printing

    Good Afternoon,
    I'm sure this is a dumb question, but I continually find that my form pages are outside of the normal print margins for a standard 8.5in x 11in paper. So far the only solution I have found is to select "Pagearea1" underneath "Master Page" and change the 'Paper Type' to 'Letter'. This seems to set the correct page width/height, but I have a concern about margins, I want to be sure the form always prints correctly regardless of the users printer settings. Is there a way to also set a margin? Also, is there a better way to do this or is the method I described the correct way?

    Ya make sure that whatever paper you're using to print is the same size as that of your MasterPage.
    Also, you'll notice when creating a form from scratch, Designer creates a Content Area for which all objects can't be outside of. For my version of Designer the content area is half an inch smaller than the page area on every side. That creates padding for the purpose of printing and general aesthetics. You can always change the size from the Master Pages view.
    If you want to force the printer to always print inside its margins, you can create a button the user presses to print with the following code in the click event (JavaScript):
    var MyDoc = event.target;
    var pp = MyDoc.getPrintParams();
    var fv = pp.constants.flagValues;
    pp.flags |= (fv.setPageSize);
    pp.pageHandling = pp.constants.handling.shrink;
    MyDoc.print(pp);
    Kyle

Maybe you are looking for

  • Cant run a program from command prompt

    i am using eclipse 3.2 for java development. programs are running from editor window, but whenever i am trying to run it from command prmpt , i am getting folowing error... ..........NoClassDefinitionFound how to resolve it...?? regards yogesh g k

  • Fresh Install of Windows 8.1 on HP Pavilion a4313w freezes randomly

    I've done four fresh installs of Windows 8.1 on the HP Pavilion a4313 Desktop PC in our home and it always freezes randomly. Even in safe mode, it freezes. I've done hardware tests with BurnIn Test 8.0 and everything including the hardware memory is

  • APEX 3.0.1 /Vista Premium   install failing:

    Hi Can anyone assist me with this ... I get following error when running chart_demo app. fm."Release 3.0 New Feature Demos" page under APEX 3.0.1 and Vista Premium: "A script in this movie is causing Macromedia Flash Player 7 to run slowly. If it con

  • How can we restrict Cost Center Company Code wise in Equiment Master (IE01)

    Hello Experts, Here is one requirement is to restrict cost center in equiment master (IE01) However SAP System is behaving as per SAP Standard function. Please see screen shot to understnad better my requirement. I want to pass relevant cost center i

  • Rough end of the pineapple

    Anyone come accross this cos I ain't? User had Adobe Acrobat 8 standard and Adobe Reader 6 installed 2 weeks ago on an XP machine with Outlook 2003. Been working fine. But in the last couple of days when she tries to open pdf's attached to the email