PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Find and Replace?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
Raj



Joined: 24 Jan 2007
Posts: 1

PostPosted: Wed Jan 24, 2007 12:58 am    Post subject: Find and Replace? Reply with quote

Have anyone tried finding and replacing a string in a pdf using the pdfsharp libraries? Any help would be much appreciated
Raj
Back to top
View user's profile Send private message
hood



Joined: 22 Jan 2007
Posts: 2

PostPosted: Wed Jan 24, 2007 8:55 am    Post subject: Reply with quote

Hi.

have no ide about PDF so this might be a totaly wrong way to do it.

I needed a simple way to handle standart PDFforms. so i createde some PDF's with []tags in them. and this all went OK...... my problem is getting the data back to a pdfFile.

A tag could looks like this [CustomerName]


---------------------------------------------------------------------------------------

PdfDocument pdfDoc = PdfReader.Open("C:/PDF/PdfContract.pdf", PdfDocumentOpenMode.Modify);


PdfContent pc = pdfDoc.Pages[0].Contents.CreateSingleContent();


string s = pc.Stream.ToString();


char[] c = { '[', ']' };
string[] sList = s.Split(c);


for (int i = 0; i < sList.Length; i++)
{
if (sList[i].Contains("CustomerName"))
{
sList[i] = CustomerObject.Name;
}
}

---------------------------------------------------------------------------------------

But then im stuck. no matter what i do, i can't use the string to create a new pdfFile.



If this should be of any help to you, and you solv the last step of saving data again..Pleace post the solution. Or if you find a better way i would also be wery happy to see it Wink

Have a nice day
TheHood
Back to top
View user's profile Send private message
SNV



Joined: 26 Dec 2007
Posts: 1

PostPosted: Wed Dec 26, 2007 6:32 am    Post subject: Reply with quote

up
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com