Aspose.pdf 表格欄位的HorizontalAlignment

您好:
Aspose.Pdf.Text.TextState中的HorizontalScaling,是否能做到分散對齊(Disperse)??

使用的Aspose.pdf版本為Version: 20.9

謝謝

@wisemaker

您是否愿意通过共享示例源和预期的输出文件来共享有关您需求的更多详细信息?另外,请分享您正在使用的代码段。我们将进一步为您提供帮助。

您好:
'Share The Source Code*********
Dim doc As New Aspose.Pdf.Document
Dim page As Aspose.Pdf.Page
Dim pTable As New Aspose.Pdf.Table

page = doc.Pages.Add

pTable.ColumnWidths = “50 50 50 50 50 50”
pTable.Border = New Aspose.Pdf.BorderInfo(BorderSide.All, 0.5F, Color.FromRgb(System.Drawing.Color.Blue))

pTable.DefaultCellBorder = New Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.5F, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red))

Dim row As Aspose.Pdf.Row

Dim textstate1 As New Aspose.Pdf.Text.TextState
textstate1.HorizontalAlignment = HorizontalAlignment.center

row = pTable.Rows.Add
row.Cells.Add(“欄位1”)
row.Cells.Add(“欄位2”)
row.Cells(1).DefaultCellTextState = textstate1
row.Cells.Add(“欄位3”)
row.Cells.Add(“欄位4”)
row.Cells.Add(“欄位5”)
row.Cells.Add(“欄位6”)

doc.Pages(1).Paragraphs.Add(pTable)

Dim resultName As String = “test_001.pdf”
Dim PrnDir As String = SystemPath & “\reportData”
’ 判斷路徑是否存在,無則建立 必要項
Dim DirectoryInfo = New DirectoryInfo(PrnDir)
If Not DirectoryInfo.Exists Then DirectoryInfo.Create()

doc.Save(PrnDir & resultName, Aspose.Pdf.SaveFormat.Pdf)
'Share The Source Code*********

  1. 附上圖片,HorizontalAlignment的屬性,選不到Disperse,
    2020.09.11_10h40m05s_001_.png (8.9 KB)

@wisemaker

您能否也请分享屏幕截图或文件,以便我们可以看到分散(Disperse)水平对齐的样子?我们将研究添加它的可行性并与您分享我们的反馈。

您好:

我使用WORD來做展示,如圖片中的"欄位二",平均分散於表格的欄位中,再麻煩您們測試其可行性。
謝謝!

2020.09.14_15h49m18s_001_.png (43.5 KB)

@wisemaker

您可以尝试使用Horizo​​ntalAlignment.FullJustify选项,看看是否满足您的要求。如果您遇到任何问题,请随时告诉我们。

您好:

感謝您建議的方法,有實作於cell 與 文字中的HorizontalAlignment.FullJustify與HorizontalAlignment.Justify,目前仍是無法達到我想要的功能。

是否有Simple code,對於HorizontalAlignment.FullJustify的效果展示??

謝謝

@wisemaker

我们可以注意到我们的API既不尊重Jsutify也不支持FullJustify对齐方式。因此,我们在问题管理系统中将问题记录为PDFNET-48779。我们将进一步调查其详细信息,并让您了解其解决状态。请给我们一些时间。

我们对造成的不便很抱歉。