diff --git a/range/Advanced/TSPdfParagraphRange.tsf b/range/Advanced/TSPdfParagraphRange.tsf index fe4fd0e..ce98a20 100644 --- a/range/Advanced/TSPdfParagraphRange.tsf +++ b/range/Advanced/TSPdfParagraphRange.tsf @@ -407,6 +407,8 @@ begin {self.}DynamicHeight += diff; if_newline := {self.}EndX + range.Width - {self.}StartX > {self.}Width + 1e-6; 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 begin 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); "emf": image := docx_to_pdf_.GetPdf().LoadEmfImageFromFile("", image_path); + "wmf": + image := docx_to_pdf_.GetPdf().LoadWmfImageFromFile("", image_path); end; fileDelete("", image_path); 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': 'jpg', 'position': 0, 'value': array(0xFF, 0xD8)), ('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 begin diff --git a/range/basic/TSPdfImageRange.tsf b/range/basic/TSPdfImageRange.tsf index c74ecdb..4c386aa 100644 --- a/range/basic/TSPdfImageRange.tsf +++ b/range/basic/TSPdfImageRange.tsf @@ -17,9 +17,11 @@ end; function TSPdfImageRange.Do(); 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 {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 {self.}TSPage.PdfPage.DrawImage({self.}Image, {self.}EndX, {self.}EndY, {self.}Width, {self.}DynamicHeight);