Portal 2014

Add new button

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

using System;
using System.Diagnostics;
using System.IO;

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")));
    
    		// Add a new button in a new menu and section
    		this.PdfWebControl1.AddMenu("Example");
    		this.PdfWebControl1.AddSection("Example", "ExampleSection");
    		this.PdfWebControl1.AddItem("Example", "ExampleSection", "JS Fuction", "glossy_red.svg", false, "", "ShowAlert(\"Example Button\");"); 
    	}
    }
  
}

Add new button.aspx

<%@ Page Language="C#" CodeFile="Add_new_button.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">
    <script type="text/javascript">	
    	// Create a javascript function to call from the new button
    	function ShowAlert (from) {
    		alert("Hello from " + from);
    	}
    </script>
    <div>
    	<apPortalUI:PdfWebControl ID="PdfWebControl1" runat="server" Height="600px" Width="100%" />
    </div>
  </form>
</body>
</html>

Copyright © 2018 ActivePDF, Inc