Skip to content

Instantly share code, notes, and snippets.

@Polaringu
Created October 20, 2016 12:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Polaringu/10ccd1510cc65be18024ccd54f5072d2 to your computer and use it in GitHub Desktop.
Save Polaringu/10ccd1510cc65be18024ccd54f5072d2 to your computer and use it in GitHub Desktop.
private void addRotatedTextToolStripMenuItem_Click(object sender, EventArgs e)
{
PDFXEdit.IPXC_Document doc = pxcInst.NewDocument();
PDFXEdit.PXC_Rect rcMedia;
rcMedia.left = 0;
rcMedia.bottom = 0;
rcMedia.top = 800;
rcMedia.right = 600;
PDFXEdit.IPXC_UndoRedoData urData;
PDFXEdit.IPXC_Page page = doc.Pages.InsertPage(0, ref rcMedia, out urData);
PDFXEdit.PXC_Rect rcText;
rcText.left = 100;
rcText.bottom = 600;
rcText.top = 700;
rcText.right = 300;
PDFXEdit.IPXC_ContentCreator CC = doc.CreateContentCreator();
PDFXEdit.PXC_Rect rcBlock;
CC.TranslateCS(100, 0); //Shifting 100 by X axis
CC.RotateCS(3.0); //3 degrees rotation
CC.ShowTextBlock("Test Text Block Text", rcText, rcText, 0, -1, null, null, null, out rcBlock); //draw text block
page.PlaceContent(CC.Detach(), (UInt32)PDFXEdit.PXC_PlaceContentFlags.PlaceContent_After);
pdfCtl.OpenDocFrom(doc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment