PDF water Mark Problem

Hi,

I was using PDF 7.9 version and there was no problem with this version.I upgrade my version to 8.2 and now I am getting an error.I attached screenshot for u

I am using following code;

<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

string kKopya = "KONTROLLÜ KOPYA";

if (kKopya != "")

{

int iFontSize = 36;

System.Drawing.Color YaziRengi = new System.Drawing.Color();

YaziRengi = System.Drawing.Color.Red;

int iYer = 4;

int iAci = 45;

PdfFileInfo fileInfo = new PdfFileInfo(“C:\\deneme.pdf”);

Aspose.Pdf.Facades.Stamp aStamp = new Aspose.Pdf.Facades.Stamp();

kKopya = kKopya.Replace("ı", "i").Replace("İ", "I").Replace("ş", "s").Replace("Ş", "S").Replace("ğ", "g").Replace("Ğ", "G");

FormattedText formatText = new FormattedText(kKopya, YaziRengi, Aspose.Pdf.Facades.FontStyle.CourierBold, EncodingType.Cp1252, false, iFontSize);

aStamp.BindLogo(formatText);

float vtext = formatText.TextHeight / 2, htext = formatText.TextWidth / 2;

aStamp.IsBackground = false;

aStamp.Opacity = 0.4f;

aStamp.Rotation = iAci;

float iAngel = (float)(Math.PI * iAci / 180.0);

float fx = 0, fy = 0, cons = 30;

switch (iYer)

{

case 4: fx = fileInfo.GetPageWidth(1) / 2; fy = fileInfo.GetPageHeight(1) / 2;

break;

default: fx = cons; fy = cons;

break;

}

fx = (float)(fx - (System.Math.Cos(iAngel) * htext));

fy = (float)(fy - (System.Math.Sin(iAngel) * htext));

if (fx < 0) fx = cons;

if (fy < 0) fy = cons;

aStamp.SetOrigin(fx, fy);

PdfFileStamp stamper = new PdfFileStamp(“C:\\deneme.pdf”, “C:\\deneme2.pdf”);

stamper.AddStamp(aStamp);

stamper.Close();

Our customers have internal audit.This problem is very urgent for us

I noticed that it is related with “Ü”.Please check it

Hi Ahmet,


Thanks for your inquiry. I’m afraid I’m unable to reproduce issue while testing the scenario with your provided code snippet. Its working fine, sample output is enclosed here. Can you please share the problematic PDF document and also confirm whether you are getting issue with some specific document or every document is causing the issue?

Moreover as a second thought, Can you please double check your license implementation. Sometimes this exception arises due to license implementation. Its is recommended to set license once per application domain. May be you can place the license initialization
code in Main(), Page_Load() or any method which is executed at the start of
application.

Best Regards,

Did you try with “KONTROLLÜ KOPYA”.Because problem ocur when I use “Ü” letter.

Hi there,


Yes its working fine with me. It seems exception arises due to “Region and Language” setting of your machine. As I’ve noticed the exception while changed my system setting from English to Turkey. Can you please confirm your machine settings? So we log the issue accordingly for further investigation.

Best Regards,

Hi Ahmet,

In addition to above reply, I've also logged subjected issue as PDFNEWNET-35743 for further investigation and resolution. We'll notify you via this thread as soon as it is resolved. Meanwhile, as a workaround you can set "Region and Language" options to United State.


Please feel free to contact us for any further assistance.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-35745;PDFNEWNET-35743) have been fixed in Aspose.Pdf for .NET 8.6.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.