If set, each PDF page will be converted to an image.

Namespace: TallComponents.PDF.Rasterizer
Assembly: TallComponents.PDF.Rasterizer (in TallComponents.PDF.Rasterizer.dll) Version: 3.0.72.2

Syntax

C#
public bool ConvertToImages { get; set; }
Visual Basic
Public Property ConvertToImages As Boolean
	Get
	Set

Remarks

If this property is false, the unlicensed versions of this software will only convert the first page of a document. Set this property to true in order to obtain bitmap output for all pages.

Internally, our software produces these bitmaps by executing code that is very similar to the code below. If you want to have more control over generating bitmaps it is best to set ConvertToImages to false and implement similar code.

CopyC#
FixedPage internalPage = page.ConvertToWpf(renderSettings, convertOptions, summary);

double width = page.Width * 96.0 / 72.0;
double height = page.Height * 96.0 / 72.0;

Size pageSize = new Size(width, height);

// Create a new 96 dpi bitmap from the visual.
System.Windows.Media.Imaging.RenderTargetBitmap bmp =
  new System.Windows.Media.Imaging.RenderTargetBitmap((int)(width), (int)(height), 96, 96, System.Windows.Media.PixelFormats.Pbgra32);

bmp.Render(internalPage);

Image image = new Image();
image.Source = bmp;

FixedPage fixedPage = new FixedPage();
fixedPage.Children.Add(image);

fixedPage.Measure(pageSize);
fixedPage.Arrange(new Rect(new Point(), pageSize));
fixedPage.UpdateLayout();

See Also