Search code examples
wpfvb.netpdfteechart

Exported TeeChart to PDF shows error in Acrobat Reader after printing


When exporting a TeeChart to a PDF I get an error after printing it with Acrobat Reader X.

EDIT: When using different fonts none of used fonts is found and all are replaced by a standard font.

Code

    chart.Export.Image.PDF.Height = Math.Round(chart.ActualHeight, 0)
    chart.Export.Image.PDF.Width = Math.Round(chart.ActualWidth, 0)
    chart.Export.Image.PDF.Save(filename)

btw. needed to round the hight/width as the exported PDF is broken sometimes when not doing so. Maybe because of the sometime many digits of ActualHeight values in WPF.

Sample file: PDF


Error message from Acrobat Reader X

An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.

Open in GSView (or other PDF Viewers like SumatraPDF) throw no error, but GSView show alot of stuff in the messages.

Messages from GSView

GSview 5.0 2012-01-17
GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Scanning PDF file
   **** Warning:  length of some xref entries is not equal to 20 bytes.
%GSVIEW_PDF_PAGES: 1 1
Displaying PDF page 1
%GSVIEW_PDF_PAGE: 1
%GSVIEW_PDF_MEDIA: [0 0 400 250]
%GSVIEW_PDF_ROTATE: 0
Warning: EPS file must not use /setglobal
Warning: EPS file must not use /setglobal
Warning: EPS file must not use /setglobal
Warning: EPS file must not use /setglobal
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
Warning: EPS file must not use /setglobal
Warning: EPS file must not use /setglobal
Warning: EPS file must not use /setglobal
Scanning c:\psfonts for fonts... 0 files, 0 scanned, 0 new fonts.
Warning: EPS file must not use /setglobal
Can't find (or can't open) font file %rom%Resource/Font/F0.
Can't find (or can't open) font file F0.
Querying operating system for font files...
Didn't find this font on the system!
Substituting font Courier for F0.
Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3168784 1826611 4629224 3331406 3 done.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.
   **** Warning: Tf refers to an unknown resource name: F0 Assuming it's a font name.

I changed all fonts from axis, legend, title... but error still appears. Looks like the font name is not written to the generated PDF.

Anything I can do about that? Looks not so good to get an error message each time you want to print an PDF from TeeChart.

Using TeeChart WPF (4.1.2012.1312), but made a test project with win forms and the same error shows.


Solution

  • I get this error message after printing the PDF file:

    "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem."

    The file prints correctly but the PDF file ignores font name settings so I have added the defect (TF02016650) to the bug list to be fixed.