cancel
Showing results for 
Search instead for 
Did you mean: 

Printing report from CR11 (.NET) to PCL driver uses downloaded fonts

Former Member
0 Kudos

I am working on an application that prints reports to a 3rd party system which captures PCL streams using the "HP LaserJet 5000 Series PCL 5" driver and converts the stream to text searchable documents. Problem is when my application prints from the Crystal 11 runtime with .NET running on Windows XP SP3 the PCL streams are valid but the report text cannot be extracted. However, when printing the same report from Crystal Designer XI text can be extracted from the PCL stream.

I've come to understand that the difference is that when printing from the runtime, the PCL driver is deciding to use a soft (downloaded) font because the resident font in the driver doesn't exactly match the font in the report/application. Apparently when fonts are download, the text is obfuscated for proprietary reasons leading to my problem. Where as, when printing the exact same report from the Designer, the driver finds a match and uses the resident font which means the driver won't obfuscate the text. At least this is my understanding of the problem having worked a few other forums.

So, my questions are:

1) Does the runtime behave differently because its running under .NET which uses different font libraries then the designer?

2) Is it possible to somehow embed the font in the RPT file from the Designer so that the runtime engine uses the same font and thus allows the driver to properly match the resident font? -- I'm afraid I'm not enough of a reports expert to know if this is possible. I've played around in the designer but haven't found anything.

View Entire Topic
former_member183750
Active Contributor
0 Kudos

1) Does the runtime behave differently because its running under .NET which uses different font libraries then the designer?

- Yes, that is correct. Just to add. Yo can use just about any font in the CR designer, but it may not work using the .NET runtime. E.g.; the font must be supported by the .NET framework. If it is not, you will see all kinds of issues.

2) Is it possible to somehow embed the font in the RPT file from the Designer so that the runtime engine uses the same font and thus allows the driver to properly match the resident font? -- I'm afraid I'm not enough of a reports expert to know if this is possible. I've played around in the designer but haven't found anything.

- No it is not. But this issue may be again related to the support of the font by the .NET framework. You should check into that. One way would be to use the following code to see if the font is recognized by the framework.

foreach(FontFamily ff in FontFamily.Families)

{

System.Diagnostics.Debug.WriteLine(ff.Name);

}

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Former Member
0 Kudos

Thanks for the info (and code). The report is using Courier New and that is listed in the .NET Font Family.

I realize this is a stretch but would it be possible to have the report choose a font from the printer driver at runtime?

former_member183750
Active Contributor
0 Kudos

To answer the question; not possible. Even if you 'd use the printer font right at design time of the report, I doubt .NET framework would be able to use that font.

For the issue at hand.

Make sure the same printer driver is installed on both your development and runtime environment.

Ensure driver is set to be your default printer on both machines.

Create the report using the default printer driver.

At runtime, do not set the printer driver, etc.

Print.

Ludek