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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF output from VFP report 1

Status
Not open for further replies.

SitesMasstec

Programmer
Sep 26, 2010
526
Brasil
Hello colleagues!

I had created a report in VFP 9, which I designed some pre-defined boxes and prints data.
For example:

If I send to a printer, it prints OK...
_________________________________________________________
| Aug 31, 2016 | John Doe | Los Angeles | CA |
|________________|_____________|___________________|_____|

... but if I "print" in PDF Creator, it shows in VFP preview report screen like this:
(and when printing it is also bad)
______________________________________
| Aug 31, 2016| John Doe Los| Angeles CA
|_____________|_________|________|___|


The text is in the correct position, but the pre-defined boxes (which I designed in the form) are smaller than the real sizes

I have 2 PCs, both with Windows 7 Ultimate and PDF Creator. In one PC machine it shows and prints PDF well! But in the other it prints that bad.

How to solve this problem in that machine ?




Thank you,
SitesMasstec
 
Please tell us you did NOT use linedraw characters to create those boxes as you appear to have done here.

Use the SHAPE control instead.
 
Reinstalling PDF Creator and VFP in both PC might help you.
Few days back I had same problem , but in 1 PC I had Windows 7 and in 1 Windows server 2008 and same PDF creator. Reinstalling Vfp in Server 2008 solved my issue. Don't know reason for it.
 
I agree with Dan. There are specific report controls that you should use to create the desired effect, specifically lines, rectangles and rounded rectangles. If you are using underscores and pipes you are bound to get incorrect results, for the simple reason that the font you are using for the labels is proportional, so the width of a given label will vary according to the text that it contains.

I disagree with Kalpi. It might possibly be worth re-installing PDF Creator, but I can't think of any good reason to re-install VFP. It is highly unlikely that this problem is caused by a missing or corrupted VFP component, but even if it was, it would be much simpler to replace the component in question.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I'm with Mike, I think the font is proportional and the PDF printer is not matching the 'real one' on the font.

Better in this case to use lines and shapes in the report designer than trying to get bars to line up these days - unless you
use a font like courier which is fixed rather than proportional.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
[highlight #FCE94F][/highlight]Hello colleagues!
Mike, I did not design pipes or underscores in the form(I used them just here in this post)
Indeed these graphic elements were from a printed form which I scanned and put on VFP report.
And I put some fields from records on the VFP report.
That works fine in one computer but not in another with the same configuration (Windows 7 , PDF Creator)


Thank you,
SitesMasstec
 
That works fine in one computer but not in another with the same configuration

In that case, there must be something different between the two machines. If you can figure out what that is, you might be close to getting an answer.

It could be something as simple as a different default font in the report designer. But that's just an example.

It might also be worth trying to eliminate PDF Creator from the equation. Try using another PDF driver, and see if the problem goes away.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike, I did not design pipes or underscores in the form(I used them just here in this post)
Indeed these graphic elements were from a printed form which I scanned and put on VFP report.

This thread might have been shorter if you'd included this information from the start.

What format is the scanned image? (JPG? PDF? Something else?) How is the scanned image included in the report? A VFP image object? An OLE blob in a general field?

What are the registered programs for handling that image format on your two PCs? I'm betting they're different, hence the different handling at display/print.
 
Dear colleagues:

The problem is not in PDF: in the Preview window (before even chosing a printer) the report has its layout changed.

Please see the big picture in the following link:

Link

Thank you,
SitesMasstec
 
Looks like the font in the PDF is not matching the one in the designer.

You could rename a font to suit your app, include it as a binary file within the app and get the users to install it if the fount does not exist on the target machine - then make sure your report uses you newly renamed font.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Is there any overriding reason to use a scanned-in image for this report? You have successfully used shape controls (lines and rectangles) in the upper half of the page. Can you not use them in the lower part as well?

I know they are fiddly to set up, but once you've done that, you should have no further problem. I've used very complex shapes in many of my reports, and they have always worked well.

Admittedly this is a workaround rather than a solution, but it could be a good approach.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 

Griff: the problem is not with the fonts! It is about the scanned image I put on report form.

Mike: The scanned image is an official bank document, and I definitely should not change it. So I scanned it and put it on the report.

IMPORTANT: The preview (and printed) report shows up correctly in one computer and smaller in another. Both computers are running Windows 7.



Thank you,
SitesMasstec
 
I ask again:
danfreeman said:
What format is the scanned image? (JPG? PDF? Something else?) How is the scanned image included in the report? A VFP image object? An OLE blob in a general field?

What are the registered programs for handling that image format on your two PCs? I'm betting they're different, hence the different handling at display/print.
 
Again recommended:

Olaf Doschke said:
I would look for different dpi setting of system fonts.

That doesn't only effect font sizes, it also means image sizes may be computed different. Though you mainly change font sizes this way and it should change printer dpi, but only screen dpi, we've seen it change tha resizing of images in reports.

SitesMasstec said:
in the Preview window (before even chosing a printer) the report has its layout changed

There is no printing, real or preview, happening just inside VFP, it's always done with a current printer setting. So choosing the printer after preview means you get another print than preview, it's rendered again, different, when you redo the form with another printer choosen. So the printer choice MUST be put before even printing the preview, if the preview should show you what that printer would print. That's also very essential.

Bye, Olaf.
 
I'll stop banging on about fonts then!


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Hello colleagues!

Dan: the scanned image is a JPG image.

This image was included in the report this way:
- Properties, General, Control source type:
Image file name

-Properties, General, Control source:
d:\sistemas\w\boletos\bole1bbr.jpg

-Properties, General, If source and frame are different sizes:
Clip contents

Mike: is it not the same when you include an image the way I use and using shape controls??

Olaf: I will try to define the same printer as a default printer in the 2 computers, later (the computers & printers are in another location).




Thank you,
SitesMasstec
 
-Properties, General, If source and frame are different sizes:
Clip contents

Hmmm. That looks odd. Why should the source and the frame be different sizes? Surely the whole point is to make the "frame" (that is, the OLE control) the same size as the image. I don't see any reason for wanting to "clip contents".

Have to tried making the control wider? (Sorry if that sounds obvious. You have probably already done that, but I thought I'd mention it anyway.)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike: is it not the same when you include an image the way I use and using shape controls??

Not at all. The fact that it worked when you used the shape controls (in the upper half of the page), but not when you used the image (in the lower half), seems to indicate that.

Personally, I would always use the shape controls (line, rectangle and rounded rectangle) in a case like this. You say the document is an official bank document, but I don't see why that is relevant. The bank presumably requires you to print your report with the identical lines and boxes as in their original document. But that shouldn't prevent you using the shape controls. VFP gives you very precise control over their positioning. The only limitation is the resolution of the printer, but that's unlikely to be significant - and in any case the same limitation would apply to a scanned image.

I suggest you at least try using the shape controls to get a feeling for how well it will work (but first try my earlier suggesting of making the OLE control the same width as the image).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
>I will try to define the same printer as a default printer

That's not what I said. If you want to give the user the choice of printer, simply put that choice before starting the report and thus before the preview.

You do SET PRINTER TO NAME GETPRINTER(), or if you already know you want to use your PDF Printer, ie PDFCreator, then SET PRINTER TO NAME PDFCreator - followed by REPORT FORM ... PREVIEW.

There is a) no further need for a secondary REPORT FORM TO PRINTER and b) no need to set the printer back to anything. The Default Windows Printer stays the default Window Printer.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top