| |
| ASP.NET |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<%@ Page language="c#" Codebehind="PdfInfoShow.aspx.cs" AutoEventWireup="false"
Inherits="Aspose.Pdf.Kit.Demos.PdfInfoShow"
MasterPageFile="~/tpl/Demo.Master"
Title="Show Pdf Metadata - Aspose.Pdf.Kit Demos"
%>
<%@ Register TagPrefix="dem" Assembly="Aspose.Demos.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ab721518795be73e" Namespace="Aspose.Demos.Common.HtmlControls" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
<table width="90%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="19"><img src="../../../../Common/images/heading_lft.jpg" alt="" width="19" height="41" /></td>
<td width="100%" class="demos-heading-bg"><h2 class="demos-heading-bg"> Show PDF Metadata - Aspose.Pdf.Kit</h2></td>
<td width="19"><img src="../../../../Common/images/heading_rt.jpg" alt="" width="19" height="41" /></td>
</tr>
<tr> </tr>
</table>
<p class="MsoNormal"><font size=2 face="Arial" ><span style="color:black" >This demo shows <b> Metadata information </b> of input Pdf document.
<br>Using <a href=http://www.aspose.com/documentation/.net-components/aspose.pdf.kit-for-.net/aspose.pdf.kit.pdffileinfo.html> PdfFileInfo</a> class of Aspose.Pdf.Kit component, developers can extract and display the meta information of the input PDF document.
<br>
For more information, please visit <a href=http://www.aspose.com/documentation/.net-components/aspose.pdf.kit-for-.net/show-pdf-information.html>Show PDF Information. </a><br><br></span>
<p class="componentDescriptionTxt">
Click <b>Show Info</b> to see how demo takes <a href="./resources/Aspose.Pdf.Kit.pdf">input PDF file</a>
and extracts metadata information showing it to used in the below fields.
</p>
<asp:Label id="Label1" runat="server">Input Pdf meta information is shown in the table below:</asp:Label>
<table id="table1" class="generictable">
<tr>
<th scope="col" width="96" style="height: 22px">
Key</th>
<th scope="col" width="88" style="height: 22px">
Value</th></tr>
<tr>
<td><em><strong>T</strong>itle</em></td>
<td>
<asp:textbox id="title" tabIndex="1" runat="server" Width="352px" ToolTip="Please input your new Title"
></asp:textbox></td>
</tr>
<tr>
<td><em><strong>a</strong>uthor</em></td>
<td>
<asp:textbox id="author" tabIndex="2" runat="server" Width="352px" ToolTip="Please input your new Author"
></asp:textbox></td>
</tr>
<tr>
<td><em><strong>S</strong>ubject</em></td>
<td>
<asp:textbox id="subject" tabIndex="3" runat="server" Width="352px" ToolTip="Please input your new Subject"
></asp:textbox></td>
</tr>
<tr>
<td><em><strong>K</strong>eywords</em></td>
<td>
<asp:textbox id="keywords" tabIndex="4" runat="server" Width="352px" ToolTip="Please input your new Keywords"
></asp:textbox></td>
</tr>
<tr>
<td><em><strong>C</strong>reator</em></td>
<td>
<asp:textbox id="creator" tabIndex="5" runat="server" Width="352px" ToolTip="Please input your new Creator"
></asp:textbox></td>
</tr>
<tr>
<td><em><strong>p</strong>roducer</em></td>
<td>
<asp:textbox id="producer" tabIndex="6" runat="server" Height="31px" Width="355px" ToolTip="Please input your new Producer"
></asp:textbox></td>
</tr>
</table>
<asp:Button ID="btnShowInfo" runat="server" Text="Show info" OnClick="btnShowInfo_Click" />
</asp:Content>
|
| C# |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Aspose.Pdf.Kit;
namespace Aspose.Pdf.Kit.Demos
{
/// <summary>
/// Summary of PdfInfoShow.
/// </summary>
public class PdfInfoShow : BasePage
{
protected System.Web.UI.WebControls.TextBox producer;
protected System.Web.UI.WebControls.TextBox creator;
protected System.Web.UI.WebControls.TextBox keywords;
protected System.Web.UI.WebControls.TextBox subject;
protected System.Web.UI.WebControls.TextBox author;
protected System.Web.UI.WebControls.TextBox title;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.HtmlControls.HtmlGenericControl Font1;
private void Page_Load(object sender, System.EventArgs e)
{
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
protected void btnShowInfo_Click(object sender, System.EventArgs e)
{
//read input Pdf documents
string inputfile = GetResource("Aspose.Pdf.Kit.pdf");
// create an instance of PdfFileInfo class
PdfFileInfo pdfInfo = new PdfFileInfo(inputfile);
//read meta information from input pdf file and set to controls displayed over form
// get the Author information of Pdf file and set to Author field over form
author.Text = pdfInfo.Author;
// get the producer information of Pdf file and set to Producer field over form
producer.Text = pdfInfo.Producer;
// get the Creator information of Pdf file and set to Creator field over form
creator.Text = pdfInfo.Creator;
// get the Keywords information of Pdf file and set to Keywords field over form
keywords.Text = pdfInfo.Keywords;
// get the Subject information of Pdf file and set to Subject field over form
subject.Text = pdfInfo.Subject;
// get the Title information of Pdf file and set to Title field over form
title.Text = pdfInfo.Title;
}
}
}
|
|
|
|