- Courier
- Courier-Bold
- Courier-BoldOblique
- Courier-Oblique
- Helvetica
- Helvetica-Bold
- Helvetica-BoldOblique
- Helvetica-Oblique
- Symbol
- Times-Bold
- Times-BoldItalic
- Times-Italic
- Times-Roman
- ZapfDingbats
Hi there,
Hi Tilal,
My sample code is below and I attached input-output pdf files. ReplaceText feature replace target text with blank text.
License l = new License();
l.SetLicense(“Aspose.Total.lic”);
//open document
Document pdfDocument = new Document(“d:\template.pdf”);
//create TextAbsorber object to find all instances of the input search phrase
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("#AD#");
//accept the absorber for all the pages
pdfDocument.Pages.Accept(textFragmentAbsorber);
//get the extracted text fragments
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
//loop through the fragments
foreach (TextFragment textFragmentItem in textFragmentCollection)
{
//update text and other properties
textFragmentItem.Text = “Ali Taha”;
}
pdfDocument.Save(“d:\output.pdf”);
Hi Timuçin,
Thanks for sharing the resource file.
I have tested the scenario using Aspose.PDF for .NET 8.2.0 in Visual Studio 2010 application running on top of Windows 7(X64) where I have set my regional language format to Turkish and as per my observations, the text is properly being replaced. I have used the following code snippet.
For your reference, I have also attached the resultant PDF generated over my end. We are sorry for this inconvenience.
[C#]
//open document
Document pdfDocument = new Document("c:\\pdftest\\template (1).pdf");
//create TextAbsorber object to find
//all instances of the input search phrase
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("#AD#");
//accept the absorber for all the pages
pdfDocument.Pages.Accept(textFragmentAbsorber);
//get the extracted text fragments
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
//loop through the fragments
foreach (TextFragment textFragmentItem in textFragmentCollection)
{
textFragmentItem.TextState.Font = FontRepository.FindFont("Calibri");
//update text and other properties
textFragmentItem.Text = "Ali\nTaha";
}
pdfDocument.Save("c:\\replaceText_output.pdf");
Hi,
I have tested again with your sample code and It’s not worked again. I can not understant why that is not worked. I have same environment with you.
I have attached again the output pdf.
Please give me a workaround to resolve this issue.
Hi Timuçin,
Hi,
I wonder too. I think this is very easy to programming but there is a basic issue. I can not find out a workaround.
I attached my sample vs 2010 project with reference dll’s. And also attached template and output pdf’s.
Thank you.
Hi Timuçin,
issue as PDFNEWNET-35585 in our issue tracking system. We will
further look into the details of this problem and will keep you updated on the
status of correction. Please be patient and spare us little time.
for this inconvenience.
Hi,
I am so happy, issue has been found out. And, waiting for your solution.
Thank you.
Hi Timuçin,
The issues you have found earlier (filed as PDFNEWNET-35585) have been fixed in Aspose.Pdf for .NET 10.2.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(4)