TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Behrouz Hosseini
NA
72
0
How to Get PDF Height and Width
Jun 14 2012 7:30 PM
Hi Guys,
Can you please let me know how I can get the Height and Width of a PDF document using C#.I google this and i find out I can do this using the iTextSharp but I do not know how to do that.
What I have till now is:
private void btnOpen_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
txtFileName.Text = dialog.FileName;
txtFileAdd.Text = dialog.SafeFileName;
PdfReader reader = new PdfReader(dialog.SafeFileName);
PdfImportedPage page = writer.GetImportedPage(reader, i);
// size information
txtFileWidth .Text= page.PageSize.Width;
txtFileHeight .Text = page.PageSize.Height;
}
}
as you can see I am getting error on writer, which make sense but I do not know how to declare it!
Thanks alot
Reply
Answers (
1
)
Getting dynamically the directory and files under that directory.
Using Enter to move to next text box