|
Renders and saves a page.
The page and rendering options which will be used are those
which were current at the time the RenderOperation was created.
This method is similar in functionality to XRendering.Save,
but allows safe multithreaded use.
You can create multiple different RenderOperations to render
different pages, or indeed the same page, of a document. Each
RenderOperation may live on a different thread. So the typical
process is to create multiple RenderOperations on the main thread
and then parcel them off to different threads which will call the
Save method. The only restriction is that the pages in question
must not be modified while being rendered.
Furthermore, this method generates the following events, allowing
fine tuning of the rendering operations:
- Before rendering begins, a ProcessingObject
event of ProcessingSourceType.PageContent is generated. Set the
event arguments' Cancel property to true to skip rendering
altogether.
- When a PDF path stroking or filling operator is found in the
page content, a ProcessingObject
event of ProcessingSourceType.Path is generated. Set the event
arguments' Cancel property to true to skip this object. The stream
length and position can be retrieved via the StreamPosition and
StreamLength properties. Set the stream position to null to skip
the remaining of the stream.
- When a text PDF operator is found, a ProcessingObject
event of ProcessingSourceType.Text is generated. The Unicode text
can be retrieved in the Text property of the event Info property.
the event cancel property to true to skip this object. The stream
length and position can be retrieved via the StreamPosition
and StreamLength
properties. Set the stream position to null to skip the remaining
of the stream.
- When a shading PDF operator is found, a ProcessingObject
event of ProcessingSourceType.Shading is generated. The same
comments of point 2 above apply, for skipping the object or
retrieving/setting the stream position and length.
- When an image is found (inline or XObject), a ProcessingObject
event of ProcessingSourceType.Image is generated. If the image is
XObject, the indirect object can be retrieved via the event
arguments' Object property. the event cancel property to true to
skip this object. The stream length and position can be retrieved
via the StreamPosition
and StreamLength
properties. Set the stream position to null to skip the remaining
of the stream.
- When a Form XObject is found, a ProcessingObject
event of ProcessingSourceType.FormXObject is generated. The
indirect object can be retrieved via the event arguments' Object
property. Set the event arguments' Cancel property to true to skip
this object. The stream length and position can be retrieved via
the StreamPosition
and StreamLength
properties. Set the stream position to null to skip the remaining
of the stream. In addition, because Forms contain streams, a
ProcessingObject
event of ProcessingSourceType.Stream will follow. You can set the
stream position to null to skip the stream at any time. That is
events for the objects contained in the Form stream will be
generated, as described in points 2 to 5. Setting the stream
position to null for Form objects will skip the Form stream, not
the entire page content.
Every ProcessingObject
event is followed by a corresponding ProcessedObject,
event with the same source type. The PageContent ProcessedObject
event will be the last event received, in that all the page objects
events are sandwiched between a PageContent processing and
processed events. Similarly for form streams, all the form objects
events are sandwiched between a Stream processing and processed
events, which in turn are sandwiched between the FormXObject
processing and processed events.
Any event property or event Info property not mentioned here
will be ignored.
|
|
|