PDFRasterizer.NET 4.0 is now available. Supports .NET Core. Renders pixel-perfectly.

Namespace TallComponents.PDF.Rasterizer

Class DrawJob

Represents an asynchronous drawing job.

The code below shows one way to use a DrawJob. Instead of simply calling Page.Draw(), one can create a DrawJob, start it, and then do some additional work before obtaining the drawn bitmap. drawJob = new DrawJob(page); float scale = (float) (dpi / 72F); SKBitmap mybitmap = new SKBitmap( (int) (page.Width * scale), (int) (page.Height * scale), SKImageInfo.PlatformColorType, SKAlphaType.Unpremul); drawJob.Start(mybitmap, renderSettings, PageBoundary.Default, scale); // ...Drawing will start on a separate thread. In the meantine, one could do // some additional work here. // Wait until drawing has finished. drawJob.Wait(); // Obtain a copy of the bitmap that has been drawn. SKBitmap bitmap = drawJob.GetBitmap(); One will typically use a DrawJob to render a page progesssively. After a drawing job has been started, it is possible to obtain intermediate bitmap results by calling DrawJob.GetImage() while the job is running. This can be done at arbitrary moments, for example via a timer.An easier way is to subscribe to the Updated event of the DrawJob and retrieve a new bitmap in the event handler. The Updated event will be fired regularly, but it will only be fired when the bitmap has actually been updated. After finishing the drawing job, the Updated event will be raised one last time. drawJob = new DrawJob(page); drawJob.Updated += new EventHandler(drawJob_Updated); ... drawJob.Start(...); ... void drawJob_Updated(object sender, EventArgs e) { // Obtain a copy of the bitmap for as far as it has been drawn. SKBitmap bitmap = drawJob.GetBitmap(); ... }

Syntax

public class DrawJob : Object,IDisposable

Constructors

Properties

Methods

Events

Download PDFRasterizer.NET 4.0
We will send you a download link

  • This field is for validation purposes and should be left unchanged.
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download

We have sent an email with a download link.