We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose PDF AlignmentType.Center

Please help with AlignmentType.Center. Code blows up taking out many other things in document. Same code without center alignment works. This is the code.

Aspose.Pdf.Generator.TextInfo Arial5Ctr = new Aspose.Pdf.Generator.TextInfo();

Arial5Ctr.FontName = “Arial”;
Arial5Ctr.FontSize = (float)5;
Arial5Ctr.Alignment = Aspose.Pdf.Generator.AlignmentType.Center;

private void AddFormNumber(Aspose.Pdf.Generator.HeaderFooter Header)
{
Aspose.Pdf.Generator.FloatingBox formNumber = new Aspose.Pdf.Generator.FloatingBox(75, 10);
formNumber.BoxHorizontalPositioning = BoxHorizontalPositioningType.Page;
formNumber.BoxHorizontalAlignment = BoxHorizontalAlignmentType.None;
formNumber.BoxVerticalPositioning = BoxVerticalPositioningType.Page;
formNumber.BoxVerticalAlignment = BoxVerticalAlignmentType.None;
formNumber.BackgroundColor = new Aspose.Pdf.Generator.Color(System.Drawing.Color.LightBlue.Name);
formNumber.Top = 18;
formNumber.Left = 24;

        Aspose.Pdf.Generator.Table frmNumber = new Aspose.Pdf.Generator.Table();
        //frmNumber.ColumnWidths = "200";
        frmNumber.Rows.Add().Cells.Add(m_FormNumber, Arial5Ctr);
        frmNumber.Rows.Add().Cells.Add(m_FormApprovalDate, Arial5Ctr);
       
        formNumber.Paragraphs.Add(frmNumber);
        Header.Paragraphs.Add(formNumber);
    }

Please help with AlignmentType.Center. Code blows up taking out many other things in document. Same code without center alignment works. This is the code.



Aspose.Pdf.Generator.TextInfo Arial5Ctr = new Aspose.Pdf.Generator.TextInfo();



Arial5Ctr.FontName = “Arial”;

Arial5Ctr.FontSize = (float)5;

Arial5Ctr.Alignment = Aspose.Pdf.Generator.AlignmentType.Center;



private void AddFormNumber(Aspose.Pdf.Generator.HeaderFooter Header)

{

Aspose.Pdf.Generator.FloatingBox formNumber = new Aspose.Pdf.Generator.FloatingBox(75, 10);

formNumber.BoxHorizontalPositioning = BoxHorizontalPositioningType.Page;

formNumber.BoxHorizontalAlignment = BoxHorizontalAlignmentType.None;

formNumber.BoxVerticalPositioning = BoxVerticalPositioningType.Page;

formNumber.BoxVerticalAlignment = BoxVerticalAlignmentType.None;

formNumber.BackgroundColor = new Aspose.Pdf.Generator.Color(System.Drawing.Color.LightBlue.Name);

formNumber.Top = 18;

formNumber.Left = 24;



Aspose.Pdf.Generator.Table frmNumber = new Aspose.Pdf.Generator.Table();

//frmNumber.ColumnWidths = “200”;

frmNumber.Rows.Add().Cells.Add(m_FormNumber, Arial5Ctr);

frmNumber.Rows.Add().Cells.Add(m_FormApprovalDate, Arial5Ctr);



formNumber.Paragraphs.Add(frmNumber);

Header.Paragraphs.Add(formNumber);

}

Hi Mark,

We are sorry for the inconvenience caused. While testing the scenario with the latest version of Aspose.Pdf for NET 9.0.0, We have managed to reproduce the reported issue and logged it in our bug tracking system as PDFNEWNET-36698 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

We worked around by going text with this code. Thanks for checking it out. Some of our uses of alignment center do work.

Aspose.Pdf.Generator.Text number = new Text(m_FormNumber, Arial5Ctr);
        Aspose.Pdf.Generator.Text date = new Text(m_FormApprovalDate, Arial5Ctr);
        formNumber.Paragraphs.Add(number);
        formNumber.Paragraphs.Add(date);


        Header.Paragraphs.Add(formNumber);

Hi Mark,


Thanks for your feedback. It is good to know that the workaround helped you to accomplish the task.

However, we will keep you updated about the above logged issue resolution progress.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36698) have been fixed in Aspose.Pdf for .NET 9.4.0.


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

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan