Doc to Pdf conversion issue with border line using .NET

Hi,
We are trying to generate PDF document which contains table but while the document generated the cell top and bottom borders are overlapped with the right and left border, I have attached the screenshot of a generated document,
In this case the top and bottom border set to 4 point and red color, the right and left border set to 1 pt and black color.
we have used the following code to set the border properties.

documentBuilder.CellFormat.Borders.Left.LineStyle = (LineStyle)System.ComponentModel.TypeDescriptor.GetConverter(documentBuilder.CellFormat.Borders.LineStyle).ConvertFrom(customBorder[1]);
documentBuilder.CellFormat.Borders.Left.LineWidth = Convert.ToDouble(customBorder[2]);
documentBuilder.CellFormat.Borders.Left.Color = ConvertToColor(customBorder[3]);

Please check it and let us know ASAP.
Regards
Ram

Hi Ram,
Please share your complete code sample with us to help us replicate the issue at our end. Also, please let us know which version of Aspose.Pdf for .NET are you using? This will help us replicate the issue soon.
Sorry for the inconvenience,

Hi,
The problem is occurring in 4.1.0.0 aspose pdf version and also in 10.7.0.0 version of aspose.
Please find below the code, it is rendering correctly in word but not in PDF.
Code:

protected static Aspose.Words.License licence = null;
protected static Aspose.Pdf.License pdfLicence = null;
Document doc = null;
DocumentBuilder builder = null;
public Form1()
{
    InitializeComponent();
}

public void printDocument()
{
    licence = new Aspose.Words.License();
    string asposeLicensepath;
    // Set licence from licence(.lic) file
    asposeLicensepath = @"C:\SHLTFS\RE\Dev0812\3rdParty\Aspose\Aspose.Total.lic";
    licence.SetLicense(asposeLicensepath);
    // Set Aspose.PDF License Object pdfLicence = new Aspose.Pdf.License();
    pdfLicence.SetLicense(asposeLicensepath);
    doc = new Document();
    builder = new DocumentBuilder(doc);
    Table table = builder.StartTable();
    builder.CellFormat.ClearFormatting();
    builder.InsertCell();
    printBorder(1, Color.Black, "Left");
    printBorder(3, Color.White, "Right");
    printBorder(3, Color.White, "Top");
    printBorder(3, Color.White, "Bottom");
    builder.Writeln("1");
    builder.InsertCell();
    builder.CellFormat.ClearFormatting();
    printBorder(3, Color.White, "Left");
    printBorder(1, Color.Black, "Right");
    printBorder(3, Color.White, "Top");
    printBorder(3, Color.White, "Bottom");
    builder.Writeln("2");
    builder.EndRow();
    builder.InsertCell();
    builder.CellFormat.ClearFormatting();
    printBorder(1, Color.Black, "Left");
    printBorder(3, Color.White, "Right");
    printBorder(3, Color.White, "Top");
    printBorder(3, Color.White, "Bottom");
    builder.Writeln("3");
    builder.InsertCell();
    builder.CellFormat.ClearFormatting();
    printBorder(3, Color.White, "Left");
    printBorder(1, Color.Black, "Right");
    printBorder(3, Color.White, "Top");
    printBorder(3, Color.White, "Bottom");
    builder.Writeln("4");
    doc.SaveToPdf("C:\\PdfTablw.pdf");
    doc.Save("C:\\" + "WordTable.doc");
}
private void button1_Click(object sender, EventArgs e)
{
    printDocument();
}

private void printBorder(double width, Color color, string side)
{
    switch (side)
    {
        case "Right":
            builder.CellFormat.Borders.Right.LineStyle = LineStyle.Single;
            builder.CellFormat.Borders.Right.LineWidth = width;
            builder.CellFormat.Borders.Right.Color = color;
            break;
        case "Left":
            builder.CellFormat.Borders.Left.LineStyle = LineStyle.Single;
            builder.CellFormat.Borders.Left.LineWidth = width;
            builder.CellFormat.Borders.Left.Color = color;
            break;
        case "Top":
            builder.CellFormat.Borders.Top.LineStyle = LineStyle.Single;
            builder.CellFormat.Borders.Top.LineWidth = width;
            builder.CellFormat.Borders.Top.Color = color;
            break;
        case "Bottom":
            builder.CellFormat.Borders.Bottom.LineStyle = LineStyle.Single;
            builder.CellFormat.Borders.Bottom.LineWidth = width;
            builder.CellFormat.Borders.Bottom.Color = color;
            break;
    }
}

Regards
Ram

Hi Ram,

Thanks for sharing the code snippet.

As per my understanding based over code snippet shared above, the problem seems to be related to Aspose.Words for .NET, so I am moving this thread to respective forum where my fellow workers taking care of that product would be in better position to answer this query. We apologize for your inconvenience.

Hi Ram,

Thanks for your query. I have tested the scenario and have not found any issue while using latest version of Aspose.Words for .NET. Please use the latest version of Aspose.Words for .NET. Please find the output Doc and Pdf file in attachment.

Hi,

i have looked pdf attachment and i can see that the right border is not correct, there is a small overlap between 1 and 3. There is a white mark in between 1 and 3 text.

Can you please also provide which version of Aspose you have generated this for pdf and word.

Regards,
Jitender

Hi Jitender,

Thanks for sharing the information. Please see the attached PNG file. Are you talking about the same issue mentioned in attached image file?

Hi Tahir,

Yes i am talking about the same.

Regards,
Jitender

@SHL_Dell

Thanks for sharing the information. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-6687 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir
Is there any update on the issue logged in WORDSNET-6687?
Thanks
Paolo

Hi Tahir
Can you update on WORDSNET-6687?
Thanks
Paolo

Hi,

Thanks for your inquiry. Unfortunately, your issue has not resolved yet. Currently, this issue is pending for analysis and is in the queue. I am afraid, I can’t provide you any reliable estimate at the moment. Once your issue is analyzed, we will then be able to provide you an estimate.

We appreciate your patience.

The issues you have found earlier (filed as WORDSNET-6687) have been fixed in this .NET update and this Java update.

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