Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
RenderPdfFriendlyGraphics peculiarities, workaround? documented anywhere?
posted

I'm inserting a UltraChart (GanttChart) to a pdf using RenderPdfFriendlyGraphics and Infragistics.Documents.Report (btw: so far,  I find the document engine works pretty well, nice!) and I've noticed a couple of places where rendering produces quite different results when using RenderPdfFriendlyGraphics. 

I guess it's to be expected that there are some differences to the normal rendering, but in some places I find the rendering a bit annoying. A particular problem is that Fontstyles seem to get lost. Font that I set to bold like:

[for a label]

LabelStyle labelStyle = textPrimitive.GetLabelStyle();
Font internalFont = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold);
labelStyle.Font = internalFont;

[for a textprimitive]

 textPrimitive.labelStyle.Font = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold);

are rendered as a normal font in the pdf. Therefore all the font decoration I added to the report in various places is now lost! This is bad. Is it possible to have bold fonts in a chart exported to PDF at all? Only for some fonts perhaps? FontStyle.Underline seems to work fine...

I also found that some textures/hatches are rendered differently:

eg:

PaintElement pe = ...

pe.Fill = Color.Silver;
pe.FillOpacity = 200;
pe.Texture = TexturePresets.Vertical;

here the Opacity is lost.

pe.ElementType = PaintElementType.Hatch;
pe.Hatch = FillHatchStyle.DashedHorizontal;

results in a different HatchStyle. I tried this with different Hatches and the results seem a little unpredictable. Would be great if the HatchStyle was different so that it can be a vector graphic, but unfortunately it's still a raster hatch, just a different one. 

Well, the different HatchStyles I can live with but I have overlapping elements and would really like to continue having opacity.

I believe I can still have opacity for non-textured PaintElements, so I *might* be able to reasonably around this. However, I'm wondering if there is possibly a trick or some textures for which opacity is supported and/or if it's documented anywhere what things work how when using RenderPdfFriendlyGraphics?

In general I think charts export quite well to pdf (having to use bitmaps would look much worse) for standard charts, but I do a bit of custom drawing and I guess not many people want to use textures with opacity (for overlapping elements)... :)

Thanks!

 

 

 

 

 

 

 

Parents
  • 28496
    Verified Answer
    Offline posted

    bschwehn said:

    textPrimitive.labelStyle.Font = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold);

    are rendered as a normal font in the pdf.

    when i tried this out myself, it was actually rendered as a bold font, but the PDF graphics show it a bit differently.  i attached an image.  maybe with a different font you'd get a clearer distinction between bold and regular?

    bschwehn said:

    PaintElement pe = ...

    pe.Fill = Color.Silver;
    pe.FillOpacity = 200;
    pe.Texture = TexturePresets.Vertical;

    here the Opacity is lost.

    this is a limitation of the Documents engine.  i'm not sure if it's a known issue or not, so i submitted it to the documents team in the form of a bug report.  the bug # if 35599.  feel free to inquire to Infragistics about that issue at any time in the future.

    bschwehn said:

    pe.ElementType = PaintElementType.Hatch;
    pe.Hatch = FillHatchStyle.DashedHorizontal;

    results in a different HatchStyle.

    i also entered a bug report for this one.  35600.

    for now i think the issues are limitations that we've lived with; and i'm not sure if these are because of the PDF format's own limitations or not.  in any case, the Infragistics Document Engine R&D team should have a response for us soon.

     

     

Reply Children
No Data