How do you get that layout with "any numbers of columns" in the first place?
I would guess that the layout has a fixed number of columns and those that are not needed are left blank. (or are you using Table View?)
The width of your PDF is controlled by the paper size and orientation options specified in Print Setup so you are unlikely to have many choices for changing the width of the PDF. You could, however, have several different layouts designed for different numbers of columns. You would then, either manually or via script, have to select the correct layout for the number of columns before generating the PDF.
I have a report layout in which it shows fixed number of columns lets say 12, which I needed to show in this report from my database. I have to select A4 paper vertical or horizontal. Even horizontally the page size allowes to show only 7 columns and the remaining 5 get croped. While I want all the columns to be fit in paper width by auto minimizing the font size or what so ever.
The same limitations apply to PDF"s as you encounter when printing to a regular printer.
You would need to redesign your layout to make everything narrower or select a different page size/orientation such as Legal/Landscape.
I think I have to be in limits what filemaker imposes. Thanks for your support.
IF you can redesign things so that you are adding more rows (Records) instead of adding more columns, you will find that you have a great deal more flexibility in many areas--including your PDF's as now you are just producing more pages instead of trying to specify a longer page.