Home > ASP.NET, Crystal Report > Font size problem in exporting Crystal Report to PDF using ASP.Net

Font size problem in exporting Crystal Report to PDF using ASP.Net

http://forums.asp.net/t/1212106.aspx

I noticed a font size problem in exporting Crystal Report using Crystal 11.5 and ASP.Net 3.5.  In this case I needed to export a Crystal Report contains some barcodes.  The barcodes in the exported PDF had a very small font size. Searching web, I found that this issue can be fixed using to registry keys:

SAP Knowledge Base Article:

To resolve the behavior

  1. Set the resolution of the default printer of the local computer experiencing the issue to 1200 DPI. Most printers have a default setting of 600 DPI.
  2. Create two registry keys to prevent the crxf_pdf.dll from decreasing in font size.
  3. Click StartRun. Type “regedit”. The Registry Editor appears.
  4. Create the following keys for Crystal Reports XI with the defined values:HKEY_CURRENT_USER\Software\Business Objects\Suite 11.0\Crystal Reports\Export\PDF\ForceLargerFonts
    Type: DWORD
    Recognized Values: 0,1
    Default Value: 1
    Creation Method: manual

    HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.0\Crystal Reports\Export\PDF\ForceLargerFonts
    Type: DWORD
    Recognized Values: 0,1
    Default Value: 1
    Creation Method: manual

  5. Set both registry key values to 1 to turn them on.
  6. Create the following keys for Crystal Reports XI Release 2 with the defined values:HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports\Export\PDF\ForceLargerFonts
    Type: DWORD
    Recognized Values: 0,1
    Default Value: 1
    Creation Method: manual

    HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.5\Crystal Reports\Export\PDF\ForceLargerFonts
    Type: DWORD
    Recognized Values: 0,1
    Default Value: 1
    Creation Method: manual

  7. Set both registry key values to 1 to turn them on.
  8. Restart the Crystal Reports Page, Job and Cache Servers

and for the Unix server:

UNIX, an X server client such as x-win32 must be installed. Add the keys as follows:

  1. Launch the X server client (alternatively use xming on the client machine and export the display to the client machine.
  2. Login as business Objects user
  3. Go to the business objects installation folder: cd  <bobje install>/bobje/setup/
  4. Sorce env.sh (for example: . ./env.sh).
  5. Type regedit
  6. Create the registry keys as detailed below.
    1. Create the following keys for Crystal Reports XI Release 2 with the defined values:
    2. Create a new key under ‘HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports’ called ‘Export’
    3. Create a new key under ‘HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports\Export’ called ‘PDF’
    4. Create a new Dword value called ‘ForceLargerFonts’ under ‘HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports\Export\PDF’
    5. Set the value to 1 (just double click on the name you just created)
    6. Create a new key under ‘HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.5\Crystal Reports’ called ‘Export’
    7. Create a new key under ‘HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.5\Crystal Reports\Export’ called ‘PDF’
    8. Create a new Dword value called ‘ForceLargerFonts’ under ‘HKEY_LOCAL_MACHINE\Software\Business Objects\Suite 11.5\Crystal Reports\Export’
    9. Set the value to 1 (just double click on the name you just created).
  7. Restart the Crystal Reports Page, Job and Cache Servers.

I followed the provided instruction in SAP knowledge base but it did not work for me. I set the registry at HKEY_LOCAL_MACHINE which I expected to affect IIS, and then I set the HKEY_CURRENT_USER registry (which to me is not relevant as IIS uses different profile), then restarted the web server. The result was still barcode printing in small font.

Further search on the web I found a new solution in SAP community forum: https://forums.sdn.sap.com/thread.jspa?threadID=1161804

1. Press Ctrl-Alt-Del on your keyboard, then click the Task Manager button. Click the Processes tab. The security account is listed beside your process name (for IIS 5 the process name is aspnet_wp.exe and for IIS 6 it is w3wp.exe).

2. Open the registry editor. On the Start menu, click Run then type “regedit” and click OK.

3. Navigate to the following registry sub key:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

There will be a number of keys here that start with “S-1-5”. Inspect each one and look for your security account name in the ProfileImagePath entry. Take note of the key (folder) you are on when you find your process.

4. Go to the following registry sub key:

HKEY_USERS[your security profile]\Software\Crystal Decisions\10.2\Crystal Reports\Export\Pdf

5. Right-click the sub key and click New > DWORD Value. Name the DWORD value “ForceLargerFonts” and set it to the value of 1.

6. Restart IIS, and try the application again.

My experience:

The IIS running on a XP machine where the Process Name (Image Name) equals to aspnet_wp.exe and the User Name equals to  ASPNET.   Looked at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and found that  S-1-5-21-1085031214-562591055-839522115-1004 has the value of

Value Name: ProfileImagePath

Value data: %SystemDrive%\Documents and Settings\TESTXP17908\ASPNET

Next step: I added ForceLargerFonts value to HKEY_USERS\S-1-5-21-1085031214-562591055-839522115-1004\Software\Business Objects\Suite 11.5\Crystal Reports\Export\PDF.

Restarted IIS

Result: Problem solved :)

Other web links and references:

  1. April 13, 2010 at 12:39 pm

    Thank from your post. Problem solved when export the crytal report to PDF format. But When I export to Word format, the font size still reduced. I tried add a new key named “WORD” or “MSWORD” as same as “PDF” but not effect. Can you help me? Or Have you any idea for this problem!

  1. No trackbacks yet.

Leave a comment