SAP Knowledge Base Article - Public

1835763 - Text truncates when exporting a report to PDF format from Crystal Reports

Symptom

  • Text is truncated when a report is exported to PDF format.
  • Export to PDF truncates the text when the option: ForceLargerFonts key is set to: True.
  • When exporting a report to PDF format from Crystal Reports, the text field is wrapped to the next line incorrectly, or truncated.

Environment

  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
  2. Add database fields and text to the report.
  3. Export the report to PDF format.
  4. When viewing the exported document in a PDF Reader, notice some of the text is truncated.

Cause

  • When exporting a report to PDF format, the font size is reduced by default by a small factor in order to avoid truncating text.
       
  • To retain the font size, it is possible to set the registry key: "ForceLargerFonts", to True. But if the font size is retained, there is the potential to occasionally have text truncated on the right margin. This truncation occurs due to a mismatch of how character widths are calculated between PDF and Microsoft Windows, and the printer driver.

Resolution

  • The most important factor in text rendering when exporting a report to PDF format, it's the printer driver, therefore the solution is to set the report to use a different printer driver. If after testing different printer drivers there are still text truncation, you can adjust the text positioning using the registry keys.
         
  • The Crystal Reports PDF Export functionnality has been enhanced from Crystal Reports 2011 to incorporate a new algorithm that positions characters precisely to prevent truncation from occurring, while maintaining the correct font size. This algorithm is activated and controlled by two new registry keys: UsePrecisePositioningForText, and TruncationAdjustment 
         
                 
  • To avoid truncating text when exporting to PDF format from Crystal Reports and retain the font size at the same time, add the following registry keys: UsePrecisePositioningForText, and TruncationAdjustment  
                
    WARNING: The following resolution involves editing the registry. Using the Microsoft Registry Editor incorrectly can cause serious problems. Use the Registry Editor at your own risk. For further information see the SAP Knowledge Base Article 1323322
              
            
    1. Open the Microsoft Registry Editor ( Regedit )
           
    2. In the Microsoft Registry Editor, navigate to the following path:
           
      • For 64 bit version of MS Windows:
           
        HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\PDF
         
      • For 32 bit version of MS Windows:
               
        HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\PDF
          
        Note: If the end of the path does not exist, add the directory.
          
    3. Add the DWORD key: UsePrecisePositioningForText
    4. Set the value to: 1
                 
    5. Add the DSWORD key: TruncationAdjustment
    6. Set the value to: 2
                 
    7. Restart Crystal Reports, and when exporting to PDF format, the text will no longer be truncated.
                
         
  • Important Notes:  
    • The key: UsePrecisePositioningForText, turns on the new functionality when it is set to 1.
    • When this functionality is activated, the registry key: "ForceLargerFonts"  is ignored.
    • The "TruncationAdjustment" key controls a width calculation rounding function in the new algorithm and accepts values between 0 and 10 inclusively.
    • The default value of 2 has been tested to sufficiently eliminate most truncation issues.
    • If truncation is still observed, this value can be increased for added granularity.

Keywords

Text truncates, text chops, exporting to PDF issue, crop , cropped, truncated, missing, character missing, CR 2013, CR 2011, CR2013, CR2011, overflow, overlap, cut , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016