Portal 2014

Add an arrow object

ActivePDF Portal has reached End of Life.
// Copyright (c) 2018 ActivePDF, Inc.
// ActivePDF Portal 2014
// Example generated 09/25/18 

using System;
using System.Diagnostics;
using System.IO;
using System.Drawing;
using APPortal.Data.Document;
using APPortal.Data.Document.Common;
using APPortal.Data.Document.Objects;
using APPortal.Data.Document.Objects.FormFields;
using APPortal.Data.Document.Objects.Shapes;

partial class Example : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    	if (!IsPostBack)
    	{
    		// Specify the document to open with portal
    		this.PdfWebControl1.CreateDocument("filename", System.IO.File.ReadAllBytes(Server.MapPath(@"portal.pdf")));
    
    		// Create DocumentEditor object
    		PdfDocumentEditor DocumentEditor1 =
    			this.PdfWebControl1.EditDocument();
    
    		// Add the arrow object
    		PdfArrowShape a =
    		  (PdfArrowShape)
    		  DocumentEditor1.Pages[0].CreateObject(PdfObjectCreatable.ShapeArrow);
    		
    		// Properties
    		a.LineColor = new PdfColor(Color.Blue);
    		a.LineWidth = 2;
    		a.SetLine(200, 220, 40, 160);
    
    		// Permissions
    		a.Moveable = false;
    		a.Resizable = false;
    		a.Stylable = false;
    		a.Deletable = false;
    
    		// Commit DocumentEditor changes
    		DocumentEditor1.Save();
    	}
    }
  
}

Add an arrow object.aspx

<%@ Page Language="C#" CodeFile="Add_an_arrow_object.aspx.cs" Inherits="Example" %>
<%@ Register Assembly="APPortalUI" Namespace="APPortalUI.Web.UI" TagPrefix="apPortalUI" %>

<!DOCTYPE html>
<html>
<head runat="server">
  <title>activePDF Portal Sample</title>
</head>
<body>
  <form id="form1" runat="server">
    <div>
      <apPortalUI:PdfWebControl id="PdfWebControl1" runat="server" height="600px" width="100%"
         />
    </div>
  </form>
</body>
</html>

Copyright © 2018 ActivePDF, Inc