Aspose.Pdf core font issue

Hi,

I can not use replace text feature without pre-defined fonts below. For example; Calibri and Arial.
I have Aspose.Total licence. My regional settings are Turkish.

Please help to resolve this issue or give me a workaround. I think this is a bug with other cultures.

http://www.aspose.com/docs/display/pdfnet/Font+Handling
  • 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,


Thanks for your inquiry. Can you please share your sample code snippet and input/output documents here? So we will look into your issue and will provide you more information accordingly.

Sorry for the inconvenience faced.

Best Regards,

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,


I still wonder why the problem is occurring in your environment and I am unable to replicate it over my end. Can you please share some sample application/project, so that I can once again test the scenario in my environment. We are really sorry for this inconvenience.

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,


Thanks for sharing the sample project.

Finally I have been able to replicate the issue over my end. In order to reproduce the problem, along with selecting Turkish under Format tab, I also had to specify my current location as Turkey under Regional and Language settings section. In my earlier attempts, I only specified Turkish as language format. For the sake of correction, I have logged this
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.

We are sorry
for this inconvenience.

Hi,

I am so happy, issue has been found out. And, waiting for your solution.

Thank you.

Hi Timuçin,


As soon as we have some definite news regarding the resolution of this problem, we would be more than happy to update you with the status of correction. Please be patient and spare us little time.

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)