Results 1 to 6 of 6
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Output form to PDF "shrink to fit"

    The code below works fine to send the form to a PDF in landscape orientation, but it doesn't quite fit on a single page. I can't find any references to where I can also specify "Shrink to Fit". Any ideas?


    Code:
    Forms(Me.Name).Printer.Orientation = acPRORLandscape
    DoCmd.OutputTo acOutputForm, "frmNorthTower", acFormatPDF, "c:\Revel\RDS\FloorPDFs\North4.pdf"

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    As you probably know already forms are not really meant for printing, using reports for that is the preferred approach for most developers. That being said I don't think there is a "shrink to fit" property that you can set either manually or programmatically. You should try to set that form's printer properties, such as the designated (PDF) printer, orientation and margins (I found that I need to set the margins to 0 or close to it and that is not possible with actual printers but it is with most virtual PDF printers).
    https://docs.microsoft.com/en-us/off...inter-settings
    To change the default printer and reset it:
    https://www.accessforums.net/showthread.php?t=70523

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Click image for larger version. 

Name:	000.jpg 
Views:	14 
Size:	36.0 KB 
ID:	46934
    I can't find the setup dialog for the form so I can set the margins.

    (And yes, normally this kind of application is better suited with a report. With a bit of design hindsight, the functionality with the current app might have been provided using a report UI had the user made known the variations in using the app. A re-design at this point is not even remotely justified.)

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I found it, somewhat obscured in the externals, but nonetheless. 0.116 is as close to 0 top and bottom as I can get. It almost fits, so I'll tweak the form a bit to see if I can squeeze it into a single page.

  5. #5
    sxschech is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    5
    Although one can't seem to do shrink to fit as in Excel, it may be possible to manually adjust the scale (percentage) of the print page such as 80% rather than 100%. I have used this technique when the information won't fit on the page by using a printer driver capable of post script. This is my first post here, so hope it is ok to refer you to the steps I outlined on another forum. It was written back in 2016, I tested it out and still works, however, I already have a post script printer driver installed. To follow my original steps, I tried manually adding a new one and not sure if because I'm on Windows 10 or using a work computer, it does not pull up a list of printers like it did back then, so I couldn't just pick any printer from the list - meaning if you aren't able to pick a printer capable of postscript, the capability to scale won't be available. It should work with a pdf printer drive too.

    Since it sounds like you are printing a form rather than a report, you won't get a preview of the percentage adjustment, whereas in a report print preview once the scale percent has been changed, it updates the display and you can then see if you need to adjust the percentage up or down if it is too small or still truncated.

    You only need to follow the add a printer steps if you do not already have a postscript printer installed, otherwise, you can skip down to the part about page setup.

    see Post #8 16-JUN-2016

    https://www.access-programmers.co.uk.../#post-1491765



    --I never did learn how to automate or program the scaling with vba --

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks for your thoughts and suggestions. There's no printer postscript during the pdf creation automation, so it didn't even come up during the investigation. As it is, the shape of the form will either fit into a standard page or it's too big. The end user can exercise whatever choices are available with their pdf viewer they desire, but I have to provide a single page rendering. As I posted, I set the page margins to minimum (0.116") and tweaked the form slightly to accomplish the acceptable single page rendering.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need to add "date" to automated PDF output file
    By skydivetom in forum Programming
    Replies: 3
    Last Post: 08-23-2019, 05:06 PM
  2. Simple table relationships ("faces" to "spaces" to "chairs")
    By skydivetom in forum Database Design
    Replies: 36
    Last Post: 07-20-2019, 01:49 PM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  5. Replies: 1
    Last Post: 06-07-2011, 09:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums