Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 10, 2012 02:21 AM by Frank Jiang - MSFT
Member
1 Points
15 Posts
May 07, 2012 05:42 AM|LINK
hi all,
In my application i need to send the user queries in pdf file.
I have an PDF file, i need to update userinformation(name,organication,queries) into that PDF file.
Please do let me know can i achieve this in c#
164 Points
41 Posts
May 07, 2012 05:51 AM|LINK
How do you generate pdf. Is it by Gridview export or Crystal report?
May 07, 2012 06:01 AM|LINK
I have created PDF file using MS word(save as - pdf) not using the code
2 Points
1 Post
May 07, 2012 06:09 AM|LINK
Hi You should follow the following Steps :
1- Read the PDF file:
2- while you read the PDF File you Can change it's contents
3- Re-Generate PDF File using ITextSharp
4- Some Help links :
5- Hope this info is useful for you my friend
Sincerely,
naadydev | Senior Software Engineer
May 07, 2012 06:26 AM|LINK
thank you for the quick reply.
i will try and let you know if i face any issues
May 07, 2012 09:11 AM|LINK
hi,
PdfReader reader = new PdfReader("http://localhost:49653/PDFCreate/PDFTemplate/sfsfs.pdf");
// total number of pages
int n = reader.NumberOfPages;
// size of the first page
Rectangle psize = reader.GetPageSize(1);
float width = psize.Width;
float height = psize.Height;
Console.WriteLine("Size of page 1 of {0} => {1} × {2}", n, width, height);
// file properties
Dictionary<string, string> infodict = reader.Info;
foreach (KeyValuePair<string, string> kvp in infodict)
Console.WriteLine(kvp.Key + " => " + kvp.Value);
i am getting an error @ Dictionary<string, string> infodict = reader.Info;
Error 1755 Cannot implicitly convert type 'System.Collections.Hashtable' to 'System.Collections.Generic.Dictionary<string,string>'
Please do let me know how can i proceed
All-Star
16006 Points
1728 Posts
Microsoft
May 10, 2012 02:21 AM|LINK
The post below will help you to achieve this:
http://forums.asp.net/t/1562051.aspx/1
suchithraj
Member
1 Points
15 Posts
Need to update the existing PDF file
May 07, 2012 05:42 AM|LINK
hi all,
In my application i need to send the user queries in pdf file.
I have an PDF file, i need to update userinformation(name,organication,queries) into that PDF file.
Please do let me know can i achieve this in c#
dotnetpree
Member
164 Points
41 Posts
Re: Need to update the existing PDF file
May 07, 2012 05:51 AM|LINK
How do you generate pdf. Is it by Gridview export or Crystal report?
suchithraj
Member
1 Points
15 Posts
Re: Need to update the existing PDF file
May 07, 2012 06:01 AM|LINK
I have created PDF file using MS word(save as - pdf) not using the code
NADY
Member
2 Points
1 Post
Re: Need to update the existing PDF file
May 07, 2012 06:09 AM|LINK
Hi You should follow the following Steps :
1- Read the PDF file:
2- while you read the PDF File you Can change it's contents
3- Re-Generate PDF File using ITextSharp
4- Some Help links :
5- Hope this info is useful for you my friend
Sincerely,
naadydev | Senior Software Engineer
suchithraj
Member
1 Points
15 Posts
Re: Need to update the existing PDF file
May 07, 2012 06:26 AM|LINK
thank you for the quick reply.
i will try and let you know if i face any issues
suchithraj
Member
1 Points
15 Posts
Re: Need to update the existing PDF file
May 07, 2012 09:11 AM|LINK
hi,
PdfReader reader = new PdfReader("http://localhost:49653/PDFCreate/PDFTemplate/sfsfs.pdf");
// total number of pages
int n = reader.NumberOfPages;
// size of the first page
Rectangle psize = reader.GetPageSize(1);
float width = psize.Width;
float height = psize.Height;
Console.WriteLine("Size of page 1 of {0} => {1} × {2}", n, width, height);
// file properties
Dictionary<string, string> infodict = reader.Info;
foreach (KeyValuePair<string, string> kvp in infodict)
Console.WriteLine(kvp.Key + " => " + kvp.Value);
i am getting an error @ Dictionary<string, string> infodict = reader.Info;
Error 1755 Cannot implicitly convert type 'System.Collections.Hashtable' to 'System.Collections.Generic.Dictionary<string,string>'
Please do let me know how can i proceed
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: Need to update the existing PDF file
May 10, 2012 02:21 AM|LINK
The post below will help you to achieve this:
http://forums.asp.net/t/1562051.aspx/1
Feedback to us
Develop and promote your apps in Windows Store