Dotted line shown while 'Convert Excel file to PNG'

Hi Aspose Team,
I have an issue while converting the excel file to PNG using ‘Aspose.cells’. It’s shown ‘Dotted Line’ instead of Line in PNG file.

Sample Code:

public void ExceclToPNG()
{

  	Workbook book = new Workbook("Test.xlsx");

  	Worksheet sheet = book.Worksheets[0];
  	sheet.PageSetup.LeftMargin = 0;
  	sheet.PageSetup.RightMargin = 0;
  	sheet.PageSetup.TopMargin = 0;
  	sheet.PageSetup.BottomMargin = 0;
  	sheet.PageSetup.PrintGridlines = true;

  	ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
  	imgOptions.ImageType = Aspose.Cells.Drawing.ImageType.Png;
  	imgOptions.OnePagePerSheet = true;
  	imgOptions.IsCellAutoFit = true;
  	imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;

  	SheetRender sr = new SheetRender(sheet, imgOptions);

  	Bitmap bitmap = sr.ToImage(0);
  	bitmap.Save(@"C:\Images\" + "Output_Excel.png");
  }

Input File :Test.zip (12.1 KB)

Output:Output_Excel.png (5.0 KB)

Expected:Expected_Excel.png (6.0 KB)

Could you please help us to solve the issue.

Thanks.

@msindia,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46979 - Dotted line shown while ‘Convert Excel file to PNG’

@msindia,

Please set GridlineType in ImageOrPrintOptions , it will be OK.
e.g
Sample code:

imgOptions.GridlineType = GridlineType.Hair;

@Amjad_Sahi,

Thanks for your reply. It’s working.

@msindia,

Good to know that your issue is sorted out by the suggested line of code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.