Here you will find the known issues of the TPrintPreview control, and how to workaround them.
If the width or height of the chosen paper is more than 32767 units, pages are not displayed correctly.
The control calls the SetWindowExtEx function of Windows API to sets the horizontal and vertical extents of the preview canvas based on the selected paper size and measurement unit. The SetWindowExtEx function expects a 2-byte signed integer (smallint) as its X and Y parameters, so any value bigger than 32767 are interpreted as negative by this function.
When working with large paper sizes, use a less accurate measurement unit for the Units property.
Image drawing methods do not respect transparency of images.
Transparency on printers is not guaranteed and not all print drivers support SrcErase, SrcAnd, and SrcInvert raster operations. Because of that, by default, the control ignores transparency of images.
You can combine images as needed, and then draw the final image on the canvas. Alternatively, you can set AllowTransparentDIB global variable to true, so that the control draws transparent images as expected.
After calling the BeginEdit method multiple times on a same page, the action gets slower each time.
The BeginEdit method draws the new page's content over the metafile of the old one. The Windows API does a poor job in merging these two metafiles.
If you need to edit a page for multiple times, it is better to create the page from scratch and replace it with the old one using the BeginReplace method.
When the zoom factor is other than 100% (actual size), the rendered text may appear choppy and/or pixelate.
Most likely, the font used for displaying the text is a raster font. In raster fonts, a glyph is a bitmap that the system uses to draw a single character or symbol in the font. Because the bitmaps for each glyph are designed for a specific resolution of device, raster fonts are generally considered to be device dependent, and they are not scalable.
Choose vector, TrueType, or OpenType fonts in your application. These type of fonts are scalable.
The PaintRichText and GetRichTextRect methods ignore images in a rich text content.
The PaintRichText and GetRichTextRect methods depend on the EM_FORMATRANGE windows message of rich edit control. The standard RichEditControl of Delphi does not handle the EM_FORMATRANGE message properly and ignores all the embedded objects, including images.
If your RTF content contains embedded images, use a third-party rich edit control with proper handling of the EM_FORMATRANGE message.
The preview of an RTF content may differ from its printed version.
This is a known issue of rich edit control.
To print RTF content, it is better to set the DirectPrint property to true and regenerate the pages.
There is no method to print RTF content of some third-party rich edit controls.
Some third-party rich edit controls are not derived from TCustomRichEdit control. In other hand, both PaintRichText and GetRichTextRect expect a TCustomRichEdit control as parameter.
Safely typecast your rich edit control to TCustomRichEdit when passing it to the PaintRichText or GetRichTextRect method. These methods internally use only the window handle of a rich edit control.