public void BeginContent(bool hacks4softmask)
{
if (!this.contentInitialized)
{
//this.defaultViewMatrix = new XMatrix(); //XMatrix.Identity;
//// Take TrimBox into account
double pageHeight = Size.Height;
//XPoint trimOffset = new XPoint();
//if (this.page != null && this.page.TrimMargins.AreSet)
//{
// pageHeight += this.page.TrimMargins.Top.Point + this.page.TrimMargins.Bottom.Point;
// trimOffset = new XPoint(this.page.TrimMargins.Left.Point, this.page.TrimMargins.Top.Point);
//}
//if (this.page != null && this.page.Elements.GetInteger("/Rotate") == 90) // HACK for InDesign flyer
//{
// defaultViewMatrix.RotatePrepend(90);
// defaultViewMatrix.ScalePrepend(1, -1);
//}
//else
//{
// // Recall that the value of Height depends on Orientation.
// Flip page horizontaly and mirror text.
XMatrix defaultViewMatrix = new XMatrix();
if (!hacks4softmask)
{
defaultViewMatrix.TranslatePrepend(0, pageHeight);
defaultViewMatrix.ScalePrepend(0.75, -0.75);
}
//if (!trimOffset.IsEmpty)
//{
// Debug.Assert(this.gfx.PageUnit == XGraphicsUnit.Point, "With TrimMargins set the page units must be Point. Ohter cases nyi.");
// defaultViewMatrix.TranslatePrepend(trimOffset.x, trimOffset.y);
//}
// Save initial graphic state
WriteSaveState("BeginContent", null);
// Set page transformation
WriteRenderTransform(defaultViewMatrix);
this.graphicsState.DefaultPageTransform = defaultViewMatrix;
MultiplyTransform(defaultViewMatrix);
if (!hacks4softmask)
WriteLiteral("-100 Tz\n");
this.contentInitialized = true;
}
}
bool contentInitialized;