parent
4c002f803f
commit
bdbd201e44
|
|
@ -15,8 +15,6 @@ public
|
||||||
function GetNextPage(page: TSPage): TSPage;
|
function GetNextPage(page: TSPage): TSPage;
|
||||||
function GetCurrentXmlFile(): string;
|
function GetCurrentXmlFile(): string;
|
||||||
|
|
||||||
function AddTSPageWare(flag: boolean): TSPage;
|
|
||||||
|
|
||||||
function AddTSPage(flag: boolean): TSPage;
|
function AddTSPage(flag: boolean): TSPage;
|
||||||
function LinkToToc(anchor: string; page: TSPage; left: real; top: real);
|
function LinkToToc(anchor: string; page: TSPage; left: real; top: real);
|
||||||
function AddToc(anchor: string; toc: TSToc);
|
function AddToc(anchor: string; toc: TSToc);
|
||||||
|
|
@ -25,7 +23,6 @@ public
|
||||||
function CalculateTextCoordinates(): array of real;
|
function CalculateTextCoordinates(): array of real;
|
||||||
function GetSymbol(symbol: string);
|
function GetSymbol(symbol: string);
|
||||||
function AddDocxPage(pg: TSPage; r: R);
|
function AddDocxPage(pg: TSPage; r: R);
|
||||||
function CalcParams(): real;
|
|
||||||
function AddColIndex();
|
function AddColIndex();
|
||||||
|
|
||||||
function UpdateDocxPageNumpages();
|
function UpdateDocxPageNumpages();
|
||||||
|
|
@ -130,24 +127,6 @@ begin
|
||||||
return pdf_.SaveToFile(alias, file);
|
return pdf_.SaveToFile(alias, file);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSDocxToPdf.CalcParams(): real;
|
|
||||||
begin
|
|
||||||
cols := current_sect_ware_.SectPr.Cols.Cols();
|
|
||||||
// println("cols = {}", cols);
|
|
||||||
w := 0;
|
|
||||||
if cols then
|
|
||||||
begin
|
|
||||||
for i:=0 to col_index_ do
|
|
||||||
begin
|
|
||||||
w := cols[i].W;
|
|
||||||
if i > 0 then text_point_.X += (cols[i-1].W + cols[i-1].Space);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
w := current_sect_ware_.SectPr.PgSz.W - current_sect_ware_.SectPr.PgMar.Right - current_sect_ware_.SectPr.PgMar.Left;
|
|
||||||
return w;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TSDocxToPdf.Transform();
|
function TSDocxToPdf.Transform();
|
||||||
begin
|
begin
|
||||||
for _,sect_ware in sect_ware_array_ do
|
for _,sect_ware in sect_ware_array_ do
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ begin
|
||||||
last := range_array_[length(range_array_)-1];
|
last := range_array_[length(range_array_)-1];
|
||||||
case jc of
|
case jc of
|
||||||
"center":
|
"center":
|
||||||
offset := ({self.}Width - last.EndX + first.EndX - last.Width) / 2;
|
offset := ({self.}Width + StartX - last.EndX - last.Width) / 2;
|
||||||
"right":
|
"right":
|
||||||
offset := {self.}Width - last.EndX + first.EndX - last.Width;
|
offset := {self.}Width - last.EndX + first.EndX - last.Width;
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
|
|
@ -147,10 +147,10 @@ begin
|
||||||
if ifnil(paragraph_.XmlChildPPr) then paragraph_.XmlChildPPr := new PPr();
|
if ifnil(paragraph_.XmlChildPPr) then paragraph_.XmlChildPPr := new PPr();
|
||||||
{self.}SetPPr(paragraph_.PPr);
|
{self.}SetPPr(paragraph_.PPr);
|
||||||
ppr_unit_decorator_ := new PPrUnitDecorator(paragraph_.PPr);
|
ppr_unit_decorator_ := new PPrUnitDecorator(paragraph_.PPr);
|
||||||
|
{self.}Init();
|
||||||
if not ppr_unit_decorator_.RPr.Sz.Val then ppr_unit_decorator_.RPr.Sz.Val := docx_to_pdf_.Font.GetDefaultSz();
|
if not ppr_unit_decorator_.RPr.Sz.Val then ppr_unit_decorator_.RPr.Sz.Val := docx_to_pdf_.Font.GetDefaultSz();
|
||||||
if paragraph_.PPr.PageBreakBefore then
|
if paragraph_.PPr.PageBreakBefore then
|
||||||
{self.}CheckAndAddPage({self.}LowerBound, 1);
|
{self.}CheckAndAddPage({self.}LowerBound, 1);
|
||||||
{self.}Init();
|
|
||||||
|
|
||||||
elements := paragraph_.Elements();
|
elements := paragraph_.Elements();
|
||||||
empty_flag := true;
|
empty_flag := true;
|
||||||
|
|
@ -826,7 +826,10 @@ begin
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
lines := roundto(line / 240, -1);
|
lines := roundto(line / 240, -1);
|
||||||
multi := ceil(size / sect_ware.BaseSize) * lines;
|
multi := ceil(size / sect_ware.BaseSize);
|
||||||
|
if (not ifnil(ppr_unit_decorator_.SnapToGrid) and not ppr_unit_decorator_.SnapToGrid) or
|
||||||
|
((ifnil(ppr_unit_decorator_.SnapToGrid) or ppr_unit_decorator_.SnapToGrid) and lines > multi) then
|
||||||
|
multi *= lines;
|
||||||
return sect_ware.SectPr.DocGrid.LinePitch * multi;
|
return sect_ware.SectPr.DocGrid.LinePitch * multi;
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,8 @@ function TSPdfTableRange.Calc();
|
||||||
begin
|
begin
|
||||||
{self.}SetTblTblPr(table_);
|
{self.}SetTblTblPr(table_);
|
||||||
tbl_pr_unit_decorator_ := new TblPrUnitDecorator(table_.TblPr);
|
tbl_pr_unit_decorator_ := new TblPrUnitDecorator(table_.TblPr);
|
||||||
grid_cols := table_.TblGrid.GridCols();
|
tbl_grid_unit_decorator := new TblGridUnitDecorator(table_.TblGrid);
|
||||||
for i:=0 to length(grid_cols)-1 do
|
grid_cols := tbl_grid_unit_decorator.GridCols();
|
||||||
grid_cols[i] := new GridColUnitDecorator(grid_cols[i]);
|
|
||||||
{self.}ResetCoordinates(tbl_pr_unit_decorator_, grid_cols);
|
{self.}ResetCoordinates(tbl_pr_unit_decorator_, grid_cols);
|
||||||
{self.}EndX := {self.}StartX;
|
{self.}EndX := {self.}StartX;
|
||||||
{self.}EndY := {self.}StartY;
|
{self.}EndY := {self.}StartY;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue