ImageSource imageSource =
new
ImageSource(
new
MemoryStream(
this
.ConvertWmfImageToPng(stream)));
document.Pages.AddPage().Content.AddImage(imageSource);
...
private
byte
[] ConvertWmfImageToPng(Stream wmfImageStream)
{
byte
[] pngBytes;
using
(MemoryStream pngImageStream =
new
MemoryStream())
{
System.Drawing.Image imageDrawing = System.Drawing.Image.FromStream(wmfImageStream);
imageDrawing.Save(pngImageStream, System.Drawing.Imaging.ImageFormat.Png);
pngBytes = pngImageStream.ToArray();
}
return
pngBytes;
}
When there is long text that is out of the used cell range area, this text should be included in page splitting calculations.
Also, when a cell has text that overflows its width, the text is again clipped by the cell boundaries and is not visible in the exported PDF. In a similar case Excel exports the surrounding cells to ensure that the content is visible.
Workaround: Extend the used cell range to include all the cells which the text content spans.