Portal 2014

Add new button

ActivePDF Portal has reached End of Life.
// Copyright (c) 2019 ActivePDF, Inc.
// ActivePDF Portal 2014
// Example generated 04/19/19 

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.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>
<head runat="server">
  <title>activePDF Portal Sample</title>
  <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);
    	<apPortalUI:PdfWebControl ID="PdfWebControl1" runat="server" Height="600px" Width="100%" />

Copyright © 2019 ActivePDF, Inc