parent
3b16e6969f
commit
a677e5a843
|
|
@ -407,6 +407,8 @@ begin
|
||||||
{self.}DynamicHeight += diff;
|
{self.}DynamicHeight += diff;
|
||||||
if_newline := {self.}EndX + range.Width - {self.}StartX > {self.}Width + 1e-6;
|
if_newline := {self.}EndX + range.Width - {self.}StartX > {self.}Width + 1e-6;
|
||||||
if i = 0 then if_newline := 0;
|
if i = 0 then if_newline := 0;
|
||||||
|
if if_newline and (range is class(TSPdfTextRange)) and (AnsiToUtf8(range.Text) in array(";", ":", "。", "“", "”", "!", "?", ",")) then
|
||||||
|
if_newline := 0;
|
||||||
if if_newline and range.Width < {self.}Width then
|
if if_newline and range.Width < {self.}Width then
|
||||||
begin
|
begin
|
||||||
offset := line_space > max_y ? (line_space - max_size) / 2 + max_size - max_size / 5 : max_y;
|
offset := line_space > max_y ? (line_space - max_size) / 2 + max_size - max_size / 5 : max_y;
|
||||||
|
|
@ -750,6 +752,8 @@ begin
|
||||||
image := docx_to_pdf_.GetPdf().LoadJpegImageFromFile("", image_path);
|
image := docx_to_pdf_.GetPdf().LoadJpegImageFromFile("", image_path);
|
||||||
"emf":
|
"emf":
|
||||||
image := docx_to_pdf_.GetPdf().LoadEmfImageFromFile("", image_path);
|
image := docx_to_pdf_.GetPdf().LoadEmfImageFromFile("", image_path);
|
||||||
|
"wmf":
|
||||||
|
image := docx_to_pdf_.GetPdf().LoadWmfImageFromFile("", image_path);
|
||||||
end;
|
end;
|
||||||
fileDelete("", image_path);
|
fileDelete("", image_path);
|
||||||
return array(image_type, image);
|
return array(image_type, image);
|
||||||
|
|
@ -764,6 +768,7 @@ begin
|
||||||
('name': 'png', 'position': 0, 'value': array(0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A)),
|
('name': 'png', 'position': 0, 'value': array(0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A)),
|
||||||
('name': 'jpg', 'position': 0, 'value': array(0xFF, 0xD8)),
|
('name': 'jpg', 'position': 0, 'value': array(0xFF, 0xD8)),
|
||||||
('name': 'emf', 'position': 40, 'value': array(0x20, 0x45, 0x4d, 0x46)),
|
('name': 'emf', 'position': 40, 'value': array(0x20, 0x45, 0x4d, 0x46)),
|
||||||
|
('name': 'wmf', 'position': 0, 'value': array(0xd7, 0xcd, 0xc6, 0x9a)),
|
||||||
);
|
);
|
||||||
for i:=0 to length(def)-1 do
|
for i:=0 to length(def)-1 do
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,11 @@ end;
|
||||||
|
|
||||||
function TSPdfImageRange.Do();
|
function TSPdfImageRange.Do();
|
||||||
begin
|
begin
|
||||||
// println("image = {}, x = {}, y = {}, w = {}, h = {}", {self.}image, {self.}endx, {self.}endy, {self.}width, {self.}DynamicHeight);
|
// println("image = {}, type = {}, x = {}, y = {}, w = {}, h = {}", {self.}image, {self.}Type, {self.}endx, {self.}endy, {self.}width, {self.}DynamicHeight);
|
||||||
if {self.}Type = "emf" then
|
if {self.}Type = "emf" then
|
||||||
{self.}TSPage.PdfPage.DrawEmf({self.}Image, {self.}EndX, {self.}EndY, {self.}Width, {self.}DynamicHeight);
|
{self.}TSPage.PdfPage.DrawEmf({self.}Image, {self.}EndX, {self.}EndY, {self.}Width, {self.}DynamicHeight);
|
||||||
|
else if {self.}Type = "wmf" then
|
||||||
|
{self.}TSPage.PdfPage.DrawWmf({self.}Image, {self.}EndX, {self.}EndY, {self.}Width, {self.}DynamicHeight);
|
||||||
else
|
else
|
||||||
{self.}TSPage.PdfPage.DrawImage({self.}Image, {self.}EndX, {self.}EndY, {self.}Width, {self.}DynamicHeight);
|
{self.}TSPage.PdfPage.DrawImage({self.}Image, {self.}EndX, {self.}EndY, {self.}Width, {self.}DynamicHeight);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue