Jump to content

everybyte2

Members
  • Content Count

    7
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by everybyte2

  1. everybyte2

    Printing FMX control to a PDF

    Can anybody suggest a component or library to print an FMX control to a PDF?
  2. everybyte2

    Printing FMX control to a PDF

    That would be great!
  3. everybyte2

    Printing FMX control to a PDF

    Webinar demo creates a PDF from a bitmap of the control, as a result PDF does not scale well. With a fix in Skia I do create scalable PDFs on Windows (where Printer canvas is available), but this solution is not portable, at least for Android.
  4. everybyte2

    Printing FMX control to a PDF

    Not a specific control, just a [derived] control containing rectangles and text. The closest I came across is for VCL, it creates a canvas to render to: litePDF example
  5. everybyte2

    ANN: Skia4Delphi v3.4.0

    Thanks for a quick reply! The problem of rendering to a different canvas (rather than default) is an FMX problem, not Skia problem. The TTextLayout derivative is bound to the default canvas when created and knows nothing about some other canvas type. I created a workaround which works on Windows, other platforms are untested: type TTextLayoutX = class(TTextLayout); procedure TSkTextLayout.DoDrawLayout(const ACanvas: TCanvas); var layoutClass: TTextLayoutClass; layout: TTextlayout; begin if (ACanvas is TSkCanvasCustom) and Assigned(TSkCanvasCustom(ACanvas).Surface) then DoDrawLayout(TSkCanvasCustom(ACanvas).Surface.Canvas) else begin // {$REGION 'A-Dato workaround for printing (on GDI+)'} layoutClass := TTextLayoutManager.TextLayoutByCanvas(ACanvas.ClassType); if (layoutClass <> nil) then begin layout := layoutClass.Create; layout.TopLeft := TopLeft; layout.MaxSize := MaxSize; layout.Text := Text; layout.Padding := Padding; layout.WordWrap := WordWrap; layout.HorizontalAlign := HorizontalAlign; layout.VerticalAlign := VerticalAlign; //layout.VerticalAlign := TTextAlign.Trailing; //too low layout.Color := Color; layout.Font := Font; layout.Opacity := Opacity; layout.RightToLeft := RightToLeft; TTextLayoutX(layout).DoDrawLayout(ACanvas); end; {$ENDREGION} end; end;
  6. everybyte2

    ANN: Skia4Delphi v3.4.0

    A second question about printing: Skia has an example of rendering to a PDF canvas, but this canvas is of a TskCanvas class and thus not compatible with FMX adapter class TSkCanvasCustom (which uses TskCanvas internally). Is there an easy way to create TSkCanvasCustom from a given TskCanvas instance?
  7. everybyte2

    ANN: Skia4Delphi v3.4.0

    Has anybody tried to do printing of an control ? The TextLayout is bound to TSkCanvasCustom for display but the printing goes to GDI+ canvas, which custom TextLayout knows nothing about. As a result all text is missing in the printout.
×