1. 完善页码类型的支持

2. 修复auto颜色抛出异常问题
This commit is contained in:
csh 2024-10-28 14:45:48 +08:00
parent eb6e898ed7
commit 535bdb20d4
3 changed files with 5 additions and 4 deletions

View File

@ -640,7 +640,7 @@ begin
fld_struct.Quote := true;
else if instr_text = "\\* MERGEFORMAT" then
fld_struct.MergeFormat := true;
else if instr_text = "PAGE \\* Arabic \\* MERGEFORMAT" then
else if instr_text = "PAGE \\* Arabic \\* MERGEFORMAT" or instr_text = "PAGE \\* MERGEFORMAT" then
fld_struct.PageArabicMergeFormat := true;
else if instr_text = "NUMPAGES" then
fld_struct.NumPages := true;

View File

@ -18,7 +18,8 @@ begin
// println("page = {}, endx = {}, endy = {}, DynamicHeight = {}, Width = {}", {self.}Page, {self.}EndX, {self.}EndY, {self.}DynamicHeight, {self.}Width);
if {self.}TcPr.Shd.Fill then
begin
[r, g, b] := TSColorToolKit.HexToRGB({self.}TcPr.Shd.Fill);
[r, g, b] := array(0, 0, 0);
if {self.}TcPr.Shd.Fill <> "auto" then [r, g, b] := TSColorToolKit.HexToRGB({self.}TcPr.Shd.Fill);
{self.}TSPage.PdfPage.SetRGBFill(r/255, g/255, b/255);
{self.}TSPage.PdfPage.Rectangle({self.}EndX, {self.}EndY - {self.}DynamicHeight, {self.}Width, {self.}DynamicHeight);
{self.}TSPage.PdfPage.Fill();

View File

@ -21,9 +21,9 @@ end;
function TSPdfTextRange.Do();
begin
// println("text = {}, endx = {}, endy = {}, width = {}, page = {}", ansiToUtf8(text), endx, endy, width, page);
// println("Text = {}, sz = {}, szcs = {}, rpr.I = {}", ansiToUtf8({self.}Text), {self.}RPr.Sz.Val, {self.}RPr.SzCs.Val, {self.}RPr.I);
// println("Text = {}, sz = {}, szcs = {}, rpr.I = {}, color = {}", ansiToUtf8({self.}Text), {self.}RPr.Sz.Val, {self.}RPr.SzCs.Val, {self.}RPr.I, {self.}RPr.Color.Val);
[r, g, b] := array(0, 0, 0);
if {self.}RPr.Color.Val then [r, g, b] := TSColorToolKit.HexToRGB({self.}RPr.Color.Val);
if {self.}RPr.Color.Val and {self.}RPr.Color.Val <> "auto" then [r, g, b] := TSColorToolKit.HexToRGB({self.}RPr.Color.Val);
{self.}TSPage.PdfPage.SetRGBFill(r / 255, g / 255, b / 255);
{self.}TSPage.PdfPage.SetFontAndSize({self.}Font, {self.}RPr.Sz.Val);
{self.}TSPage.PdfPage.BeginText();