Hi,
I have weird behaviour exporting reports to PDF.
If, for example, I use "Microsoft Sans Serif", then Bold and Italic effects are not displayed in PDF but only in Report Preview. Similar problems are with Tahoma - there will be Italic not processed.
Is it problem with PDFs or Export?
Here is RTF example for Test we use in XRRichText (the same can be done also using normal XRLabel):
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\fi-200\li200\lang1031\f0\fs20 Regular\par
\i Italic\i0\par
\b Bold\par
\i Bold Italic\par
\ul\b0\i0 Underlined\ulnone\par
\strike Strikethrough\b\i\strike0\par
}
Thanks.
Dimitry Remenuk
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Dimitry,
The problem you reported is a known issue. If you are using the "Microsoft Sans Serif" font type in a various combinations (Bold, Italic) in your report, everything should be fine unless it gets embedded within the resulting PDF file. Please note that if there's no bold/italics version of the "Microsoft Sans Serif" font on your machine, then when embedded, all text displayed via "Microsoft Sans Serif" will have a similar appearance (i.e. no regular/bold/italics difference). The font embedding occurs when you exclude the font name from PdfExportOptions.NeverEmbeddedFonts property. You should include the "Microsoft Sans Serif" (or Tahoma you mentioned) to PdfExportOptions.NeverEmbeddedFonts in order to achieve the correct export result. I've created a sample application using RTF data you provided to illustrate this concept.
Please refer to the attachment and feel free to contact me in case of any difficulty. I'll be glad to help you.
Thank you,
Alex.
Hi Alex,
do you have the list of all fonts that should not be embedded? In our application user can edit rich text and select any font (TrueType of course) he wants, that's why we need the list of all fonts that have similar problems.
Thanks,
Dimitry Remenuk
Hello Dimitry,
I'm afraid we can't provide you with a "never-embedded" font list, because it could vary between machines. For example, someone can delete the "Arial Bold" or the "Arial Italics" font on his machine. Then, the problem occurs when exporting the document if the "Arial" font isn't listed in the PdfExportOptions.NeverEmbeddedFonts property value. I think the easiest solution to avoid the problem is to include all common fonts into the "never embedded" font list. Please note that the problem isn't related to a particular font (Microsoft Sans Serif in your example), but a PDF document specifics.
Please let me know if this approach doesn't seem fine for you.
Thank you,
Alex.
Hi Alex,
then I have a suggestion for you to implement some modification of PdfExportOptions.NeverEmbeddedFonts where we can set that we don't need embedding at all (for example, boolean property NeverEmbedFonts or use wildcards in existing NeverEmbeddedFonts etc).
Dimitry
Hello Dimitry,
Indeed, this approach makes sense, so I've posted the corresponding suggestion to our Database. Please refer to: Export to PDF - Ability to not embed any Font defined within the report's controls (the DontEmbedAnyFonts option). You'll be notified when its status is changed.
Please feel free to update this thread if you notice another misbehavior in the current XtraReports implementation. We'll do our best to find the cause of the problem, if any.
Thank you,
Alex.