Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange report behavior

foxup

Programmer
Dec 14, 2010
328
CA
Hi,

I have a strange behavior in a VFP Report that I never encountered before. Basically, when I do a print to "Microsoft Print to PDF" it comes out fine. When I do a print to "Adobe PDF" it comes out enlarged/magified and it's cut off. Am I missing something. Is there a setting in print Adobe PDF that I need to check?

Please let me know.


Thanks,
FOXUP
 
This is just a guess, but the default printer has a direct effect on page sizes in FoxPro reports.

So if the page sizes for the default printer are smaller, the generated report will be cut off unless you set the default to a wider printer before generating the report.

You can change the default paper sizes in the control panel for all possible printers under the Preferences section. I don't use Acrobat to print PDFs, but if you don't see that option for Adobe Acrobat in the Control Panel's Preferences section, you should be able to do it from Acrobat's Page Setup menu.
 
Did You check the PaperSize in Adobe and uncheck the switch "save printer environment" in the report?
 
Solution
Set it as default. PaperSize in Adobe is set to Letter and uncheck the "save printer environment" . Sadly, same result :(
 
Here is a print screen of the difference in the results:
1732041155217.png
 
I assume it's not just a zoom level difference. So one answer that has become quite a standard about such problems is DPI awareness of applications. Since VFP is older than this property applications have, Windows will assume no DPI awareness and take responsibility - sometimes, not sure if in a minority or majority in a bad way. We obviously only see and hear about the bad cases causing problems.

Atlopes has created a manager class to take care of this: https://github.com/atlopes/DPIAwareManager

Even though it's there to care for forms and their dpi resizing management one major aspect of it is that it will tell Windows your application is dpi aware and take care of any adaptions due to high dpi displays or printers and therefore tells Windows not to interfere, which often in itself is the solution to wrong resizing, also for printing.
 
Last edited:
It's not a zoom level difference. It seems to be an Acrobat Print to PDF issue. It's almost like it's a driver issue :unsure:
 
I assume it's not just a zoom level difference. So one answer that has become quite a standard about such problems is DPI awareness of applications. Since VFP is older than this property applications have, Windows will assume no DPI awareness and take responsibility - sometimes, not sure if in a minority or majority in a bad way. We obviously only see and hear about the bad cases causing problems.

Atlopes has created a manager class to take care of this: https://github.com/atlopes/DPIAwareManager

Even though it's there to care for forms and their dpi resizing management one major aspect of it is that it will tell Windows your application is dpi aware and take care of any adaptions due to high dpi displays or printers and therefore tells Windows not to interfere, which often in itself is the solution to wrong resizing, also for printing.

You are absolutely right. I forgot about that. Although @foxup doesn't think so, I remember this exact problem with older versions of FoxyPreviewer.

The problem with FoxyPreviewer was only an issue with very high resolution displays. For example, I use a 5K monitor, and it did the exact same thing until they added support for high DPI displays, which integrate a zoom factor so the icons don't look tiny.

Here's how FoxyPreviewer handled it:


The issue here is whether there's an Adobe setting to enable high DPI.

Either way, you should be able to confirm whether it's related to high DPI by trying some other resolutions and seeing the results. If we're wrong, the result will be the same, but if Chris and I are right, the amount of the crop and zoom will change as you tinker with resolutions.
 
what should dpi be in adobe settings?
 
I just noticed that adobe acrobat uses it's own program to create PDF. It's called Distiller. Does that help in any way?
 
what should dpi be in adobe settings?
I don't know if it has any DPI settings, but if it does, you'll need to experiment because I don't use it.

But, what I'm referring to is the resolution of your actual monitor and how Windows is interpreting it. I know for example my 5K display is 218 DPI, and that using that particular display means that the OS uses scaling to make the UI look normal, otherwise the menus and icons are super tiny.

So, to test our theory, just change the resolution and/or the zoom in the system settings and see if there is ANY change. If the crop looks identical, we can eliminate that from the list of potential causes. If Chris and I are right, changing the resolution and/or zoom factors in your Windows settings will result in either more or less cropping. If there's NO change, then we look at other things.

If it does change, then we either look for a way to have Adobe compensate for the DPI change or you'll need to change your resolution and/or zoom so that you get the desired result. For example, if you keep the highest resolution the way it was, perhaps Adobe can be configured at 50% or less to work.
 
I just noticed that adobe acrobat uses it's own program to create PDF. It's called Distiller. Does that help in any way?
Distiller's been around since the very first generation of Acrobat as the engine they use to let third party programs create a PDF by treating it as a printer driver.

You should experiment with the resolutions as I mentioned to see if there is any change before tinkering with settings. As I mentioned, if there is no change, you'll know whether your monitor DPI was the root of the problem. If it does prove to be the problem you can decide to either use another resolution or zoom setting, or find a way in Adobe's distiller that allows you to factor in high DPI, perhaps by using a smaller zoom factor.
 
foxup: Do you use VFP 9 or VFP Advanced? Second is driver type You can verify if you have the correct driver by running printmanagement.msc and navigating to Custom Filters -> All Printers. - Column "Driver Name" contains driver which printer use. - Custom Filters -> All Drivers: Show column "Driver Type" What is driver type for printer "Microsoft Print to PDF" and "Adobe PDF"?
 
I changed the resolutions and the zoom in the system settings. My screen icons became bigger. So, I putzed around with that and unfortunately I'm getting the same result in the end :confused:
 
I experienced the same phenomenon.
For some reason, FoxPro reports inherit the display DPI. So when my display DPI have set to 125%, the report comes out zoomed too.
 
Hi,

I have a strange behavior in a VFP Report that I never encountered before. Basically, when I do a print to "Microsoft Print to PDF" it comes out fine. When I do a print to "Adobe PDF" it comes out enlarged/magified and it's cut off. Am I missing something. Is there a setting in print Adobe PDF that I need to check?

Please let me know.


Thanks,
FOXUP
Get CutePDF, it's free, services as a printer and you will not have any problems. We used it all the time
 
I wonder why you hesitate to simply try the DPIAwareManager?

Download it, add the dpiawaremanager to your project, in main add a line SET PROCEDURE to dpiawaremanager.prg and
Code:
LOCAL DPI AS DPIAwareManager
m.DPI = CREATEOBJECT("DPIAwareManager")
And then run the report with adobe creating the PDF.

If it doesn't work, then you should either get guidance from Adobe or use another PDF creation tool, there are very many. And FoxPreviewer has solved that dpi problem, too.
 
Foxup, are you using Foxypreviewer at all? Or do you print your report directly?

Is the pdf still cut off when you put this in your main.prg

DECLARE INTEGER SetProcessDPIAware IN WIN32API
SetProcessDPIAware()

and in Windows put the scaling factor to 100%.

If the problem still remains, I would also guess it's a driver or software problem with Adobe PDF. Why do you need Adobe PDF when you have Microsoft print to PDF working? Is it maybe an old version of Adobe PDF, which has problems with the Windows scaling factor?

Regards,
Manni
 
I've tried a bunch of things and it seems to be an Adobe PDF driver bug. I'm gonna re-create the VFP Report from scratch and hopefully that'll work. I appreciate and thank everyone for your time end efforts.

FOXUP
 
It did turn out to be the ""Save Printer Environment" in the report". I had it checked, then unchecked but never saved it. When I recreated the report it was giving me the same result so I unchecked it in the new report and it worked. Then I unchecked it in the old report and it worked. Great job to everyone. Star to "EinTerraner" since was the first to come up with the solution. Thanks again to everyone.


FOXUP
 

Part and Inventory Search

Sponsor

Back
Top