textParagraph.IsHangingPunctuation为True时,输出pdf,标点符号丢失,样例文件见Punctuation_input.xlsm,丢失的标点符号见附件中图片红框标识的地方。
允许标点符号溢出测试.zip (456.2 KB)
public static void testPunctuation()
{
// CellsHelper.DPI = 168;
Workbook workbook = new Workbook(“D:\Punctuation_input.xlsm”);
Worksheet sheet = workbook.Worksheets[“存货分析1”];
foreach (Shape shape in sheet.Shapes)
{
if (shape is Aspose.Cells.Drawing.TextBox)
{
Aspose.Cells.Drawing.TextBox textBox = (Aspose.Cells.Drawing.TextBox)shape;
// 判断文本框的名称是否以"批注文本框"开头
if (textBox.Name.StartsWith("批注文本框"))
{
TextParagraphCollection textParagraphs = textBox.TextBody.TextParagraphs;
foreach (TextParagraph textParagraph in textParagraphs)
{
Console.WriteLine(textParagraph.IsHangingPunctuation);
// textParagraph.IsHangingPunctuation = true;
}
}
}
}
workbook.Save("D:\\Punctuation_output.pdf");
}