Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri May 10, 2024 10:28 am

Hello Support team,
i'm tring to add a "header string" on the top of all pdf pages by the code below, but that partial string "<P/AA.0>" disappear from the final pdf.
Replacing '<' with '[' and '>' with ']' the pdf is generated properly. but i didn't find a good way to allow to draw < and > chars by .Canvas.DrawString method.

Code: Select all
      PdfDocument pdfDocument = new PdfDocument(File.ReadAllBytes("C:\\tmp\\origin.pdf"));
      string signatureString = "<b>DGROOVE SPA/0000087/22/04/2024/I/U/Protocollo Generale<P/AA.0></b>";
      string pageSignature = signatureString;
      PdfFont signatureFont = new PdfFont(Spire.Pdf.Graphics.PdfFontFamily.TimesRoman, 10);
      PdfBrush signatureColor = PdfBrushes.Black;
      SizeF signatureMeasures = signatureFont.MeasureString(signatureString);
      float effectiveSignatureLines = signatureMeasures.Width / PdfPageSize.A4.Width;
      double truncatedValue = Math.Truncate(effectiveSignatureLines);
      float signatureHeight = (float)((truncatedValue + ((effectiveSignatureLines - truncatedValue) > 0 ? 1 : 0)) * 20);


      PdfPageBase page;
      RectangleF signatureRectangle;
      for (int i = 0; i < pdfDocument.Pages.Count; i++)
      {
         page = pdfDocument.Pages[i];
         pageSignature = $"<span>{pageSignature} pagina {page.Document.Pages.IndexOf(page) + 1} di {page.Document.Pages.Count}</span>";
         Console.WriteLine(pageSignature);
         signatureRectangle = new RectangleF(PointF.Empty, new SizeF(page.ActualSize.Width, signatureHeight));
         page.Canvas.DrawString(
            s: pageSignature,
            font: signatureFont,
            brush: signatureColor,
            layoutRectangle: signatureRectangle,
            htmlTags: true);
      }
      pdfDocument.SaveToFile("pdf.pdf");
   
.

can you help me?

Regards
Fabrizio

fabrizio.lazzarotto
 
Posts: 20
Joined: Mon Feb 28, 2022 4:16 pm

Sat May 11, 2024 2:31 am

Hi,

Thank you for your message.
I have reproduce your issue and logged it into our bug tracking system with SPIREPDF-6748. Our dev team will investigate and fix it. Once it's resolved, we will inform you ASAP. Sorry for any inconvenicen caused.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Mon May 13, 2024 9:40 am

Doris.Liu wrote:Hi,

Thank you for your message.
I have reproduce your issue and logged it into our bug tracking system with SPIREPDF-6748. Our dev team will investigate and fix it. Once it's resolved, we will inform you ASAP. Sorry for any inconvenicen caused.

Sincerely,
Doris
E-iceblue support team


Hello Doris, thank you for your help and support.
There is any possibility to look and check the bug track status publicly?

fabrizio.lazzarotto
 
Posts: 20
Joined: Mon Feb 28, 2022 4:16 pm

Tue May 14, 2024 2:57 am

Hi,

Sorry, the bug tracking system is internal to our company and is not available to the public. If there is any progress on the issue, I will update you in time.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Wed Jun 12, 2024 4:03 am

Hi,

Thank you for your patience!
Glad to inform you that we released Spire.PDF 10.6.0, which contains the fix of issue SPIREPDF-6748. Please download from the following link to test. If there's still any issue, welcome to contact us.

Spire.PDF 10.6.0
Website download: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget download: https://www.nuget.org/packages/Spire.PDF/10.6.0

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 409
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.PDF