TWPViewPDF.WriteBitmap

<< Click to Display Table of Contents >>

Navigation:  Component Description > Methods >

TWPViewPDF.WriteBitmap

Declaration - VCL

 

function WriteBitmap(PageNo: Integer;
 format: TWPBitmapFormat;
 filename: WideString;
 Memory: TMemoryStream = nil;
 Resolution: Integer = 0;
 Compression: Integer = 0;
 LongSidePx: Integer = 0;
 HeightPx: Integer = 0): Boolean;

 

This is an universal method to convert certain pages in the loaded PDF data to bitmaps.

PageNo is the page number - 0 based.

 

Format can be: wpJPEG_RGB, wpJPEG_Gray, wpPNG_RGB, wpPNG_256, wpPNG_GRAY, wpPNG_BW, wpBMP_RGB, wpBMP_256, wpBMP_Gray, wpBMP_BW, wpAutomatic

 

Filename is either the base filename, or "Memory" can be used to create the bitmap data inside of a memory stream. "Clipboard" can be provided to create the bitmap data inside of a memory stream.

 

Resolution can be used to specify the size of the created bitmap. Alternatively the parameters LongSidePx and HeightPx can be used. LongSidePx can be used to speizfy the desired width or, if HeightPX=0, the exact pixel count of the longest side.

 

Compression is only used for JPEG images to specify the JPEG compression in range 1-100

 

 

Declaration - .NET

 

public bool WriteBitmap(int PageNo, BitmapFormat Format, string Filename,

      int Resolution = 0, int Compression = 0,

      int LongSidePx = 0, int HeightPx = 0)

 

Note: "Memory" is currently not supported in .NET edition.