I'm using asp.net ,C# to display a pdf file in a page.
see code below
in aspx file
<object data="<%=pdfPath%>" type="application/pdf"
style="height:812px; width: 603px"500px" align="top" >
</object>
in aspx.cs file (src is the file upload control to select pdf file
protected void ShowPdf()
{
if (src.FileName != "")
{
lblFile.Text = Server.MapPath(src.FileName)
src.SaveAs(Server.MapPath(src.FileName));
pdfPath = src.FileName;
divPDF.Visible = true;
}
}
this is working fyn..
now what i need is to extract the page where cursor is focusing to another folder.
i tried the below code
PdfExtractorUtility Epdf = new PdfExtractorUtility();
protected void cmdExtract_Click(object sender, EventArgs e)
{
PdfReader r = new PdfReader(lblFile.Text);
int n = r.NumberOfPages;
String[] labelstrings = new String[n];
labelstrings = PdfPageLabels.GetPageLabels(r);
Response.Write(labelstrings);
Epdf.ExtractPage(lblFile.Text, Server.MapPath(dest.FileName),labelstrings[0]);
}
where extract page is the function i got from itextsharp
see
http://www.codeproject.com/Articles/559380/SplittingplusandplusMergingplusPdfplusFilesplusinp#iTextExampleCodeExtractSinglePage
but the pagenumber is not coming into the labelstring variable.
Please advice how to get the current page number of pdf