PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 19, 2024 3:45 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Find and Replace?
PostPosted: Wed Jan 24, 2007 12:58 am 
Offline

Joined: Wed Jan 24, 2007 12:45 am
Posts: 1
Have anyone tried finding and replacing a string in a pdf using the pdfsharp libraries? Any help would be much appreciated
Raj


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

Joined: Mon Jan 22, 2007 9:07 am
Posts: 2
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 ;)

Have a nice day
TheHood


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

Joined: Wed Dec 26, 2007 6:25 am
Posts: 1
up


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 260 guests


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 post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group