Text Replaced with Font size-Font style- font family

Hi,

Current version has a method named replaceText(sourceString, destinationString, fontSize).

our project requires to have a method which shold also takes care of font family, type, font style and font name and other font information while replacing the Text ?

Can you please look into it

Regards,

Dinesh

Hi Dinesh,

I’m afraid, these features are currently not supported; however, we have logged these requirements as shown below:

PDFKITJAVA-18059: Support for Font-Family

PDFKITJAVA-18061: Support for Font-Style

PDFKITJAVA-18063: Support for Font-Color

We’ll update you via this forum thread once these requirements are supported.

We’re sorry for the inconvenience.
Regards,

Hi ,

Can I have updates on the above mentioned requirements. Without this I cant proceed with this product. Please let me when are you giving me them.

Thanks,

Arijit

Hi Arijit,

As you know, these issues have been recently logged, our team still need to investigate these requirements. It’s only when our team gets a clear understanding of the features that we’ll be able to share some estimate of these issues. Please spare us some time and you’ll be updated accordingly.

We’re sorry for the inconvenience.
Regards,

Hi,

This issue has been raised long back, And I have been instructed that if I bought the product then the priority of solving/enhancement will be fast. But it seems that things are not happening as per my expectation. We are expecting of 20 more license but the issue resolving/enhancment rate is very low.

Please look into it as soon as possible.

Thanks,

Arijit

Hi Arijit,

First of all, I’m very sorry for the inconvenience caused due to the delay in the resolution of these issues. Secondly, I would like to share that we try our level best to resolve any issues the earliest possible. However, as you know that these issues were logged recently, and also that these are totally new features being introduced into the component as per your requirement, so it might take some time.

Nevertheless, our team is currently working on these features and we’ll try to provide you these new features as soon as possible. We’re already treating these requirements as high priority. Please spare us some time.

We’re sorry for the discomfort and appreciate your patience.
Regards,

Hi,

Any updates on this.

Thanks,

Arijit

Hi Arijit,

These features have been supported in our upcoming monthly release due at the end of this month - July 2010. You’ll be updated via this forum thread once the new release is published.

If you have any further questions, please do let us know.
Regards,

Hi

Can I have one hot fix please. This is very urgent for me. Cant wait till month end. Our developer is also trying if they could do with some other ways to complete the job.

Please let me know.

Thanks,

Arijit

Hi Arijit,

I have asked our development team to prepare a hot fix if feasible with the current code base. We’ll update you via this forum thread once it is ready.

Regards,

Hi,

Any updates from your developers?

Thanks,

Arijit

Hi Arijit,

A hot fix for these issues will be available early next week.

Regards,

Hi Arijit,

Please find attached the hot fix for these three requirements.

If you have any further questions, please do let us know.
Regards,

Hi,

Thanks for your hot fix and unfortunately it looks like not working.please find the attached templates.
And also when i am trying to use the replaceText(String source,String dest, TextProperties textProperties) method is throwing an exception
ava.io.IOException: InputStream cannot be null
at com.aspose.pdf.kit.gt.a(Unknown Source)
at com.aspose.pdf.kit.PdfContentEditor.replaceText(Unknown Source)
at com.aspose.pdf.kit.PdfContentEditor.replaceText(Unknown Source)
at com.yelladworks.spec.service.impl.GenerateSpecImpl.generatePrintSpec(GenerateSpecImpl.java:158)

Also the TestProperties.setColor method is also throwing some exceptions like Color is out of range for Reed…

what we exactly want is that anyway color is maintaing with the current version 3.1 we want is we will pass the font name along with the size so that it replaces the text exactly with same font what is there in the template.

Also why Aspose is not able to maintain the font while replacing the text ?

FYI…
i am trying the following code

String fontName=“AvantGarde-Bold”
int fontSize=12;
TextProperties textProperties = new TextProperties();
textProperties.setFontFamily(fontName);
textProperties.setTextSize(fontSize);
editor.replaceText(text1, “Arijit sarkar”, textProperties);
My sample font name would be like
AvantGarde-Bold, Eurostile-ExtendedTwo, AvantGarde-Book, AvantGarde-CondDemi…

I guess its not taking the style after -


Thanks,
Arijit


Hi Arijit,

I have tested this issue at my end but I couldn’t notice any issue. I need a little help from your end, so I would be able to investigate the issue.

First of all, please share a complete code snippet which can help us reproduce the issue at our end.

Secondly, please also share the font file with us, as I can’t find this font at my end. Moreover, it seems like this is an Open Type Font; I’m afraid, currently the replaceText with TextProperties class supports only Standard Type 1.

Thirdly, we need to see how you’re trying to specify the font color; it should be like this: textProperties.setColor(java.awt.Color.red);

Lastly, as far as font name is concerned, if the font is supported it’ll be replaced properly. However, if you’re trying to replace only the text and want to maintain the older font family then you need to make sure that you have embedded the font completely in the file, not partially.

Please share complete code snippet along with the font file, so we could test it at our end.

We’re sorry for the inconvenience.
Regards,

Hi,


Thanks for your reply,

Firstly, the code snippet i am trying to use is

PdfContentEditor editor = new PdfContentEditor();
editor.bindPdf(sourceFileName);
if(templateFontDetail.getFontSize() == 0){
editor.replaceText(line.trim(), replaceValue);
} else {
TextProperties textProperties = new TextProperties();
textProperties.setFontFamily(templateFontDetail.getFontName());
textProperties.setTextSize(templateFontDetail.getFontSize());
editor.replaceText(line.trim(), replaceValue, textProperties);
}


I am reading the pdf template and storing the fontname and fontsize in templateFontDetail object.
The values that are coming are say "AvantGarde-Bold, Eurostile-ExtendedTwo, AvantGarde-Book, AvantGarde-CondDemi…"
and font size is 11


Secondly,i don’t have any font file Please send me what font you support.

Thirdly, i am not passing any font color since the aspose is maintaining the Font color.

And how can i embed the Fonts completely so that it can maintain the same font. I am using Adobe illustrator to generate the pdf templates.

Also please let me know if the fonts are embeded properly or not in the template i have attached.
Here also i am attaching some font files Bauhaus-Medium.pfm and Bauhaus-Bold.pfm

Thanks,
Arijit



Hi Arijit,

We’ll get back to you regarding the details on this issue shortly. Please spare us some time so we could look into it in detail.

We’re sorry for the inconvenience and appreciate your patience.
Regards,

Hi Arijit,

We have further looked into this issue and I would like to inform you that currently you can only use 14 Standard Type 1 Fonts as given below:

“Times-Roman, Helvetica, Courier, Symbol, Times-Bold, Helvetica-Bold, Courier-Bold, ZapfDingbats, Times-Italic, Helvetica-Oblique, Courier-Oblique, Times-BoldItalic, Helvetica-BoldOblique, Courier-BoldOblique”

If you want to use other fonts then we’ll have to investigate in detail and then support it; however, it might take some time.

Moreover, the file you shared contains subset of the fonts; as you are using Adobe Illustrator to create PDF file, you have to embed the fonts using that same tool; you might have to post a query in the Adobe Illustrator forums or need to consult the Adobe Illustrator documentation.

We’re sorry for the inconvenience. If you find any further questions or concerns, please do let us know.
Regards,

The issues you have found earlier (filed as 18063;18061;18059) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi ,


Glad to have a new release, unfortunately this is also giving me the same problem that i have posted before i.e…

Firstly, the code snippet i am trying to use is

PdfContentEditor editor = new PdfContentEditor();
editor.bindPdf(sourceFileName);
if(templateFontDetail.getFontSize() == 0){
editor.replaceText(line.trim(), replaceValue);
} else {
TextProperties textProperties = new TextProperties();
textProperties.setFontFamily(templateFontDetail.getFontName());
textProperties.setTextSize(templateFontDetail.getFontSize());
editor.replaceText(line.trim(), replaceValue, textProperties);
}


I am reading the pdf template and storing the fontname and fontsize in templateFontDetail object.
The values that are coming are say "AvantGarde-Bold, Eurostile-ExtendedTwo, AvantGarde-Book, AvantGarde-CondDemi…"
and font size is 11


Secondly,i don’t have any font file Please send me what font you support.

Thirdly, i am not passing any font color since the aspose is maintaining the Font color.


Thanks,
Arijit