update3 20260610
This commit is contained in:
@@ -1045,6 +1045,26 @@ namespace DOCGEN.Klassen
|
||||
|
||||
|
||||
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
|
||||
try
|
||||
{
|
||||
string imagesize = "";
|
||||
try
|
||||
{
|
||||
imagesize = System.IO.File.ReadAllText(@"d:\apps\ondoc\service\clmresizefile.txt");
|
||||
}
|
||||
catch
|
||||
{
|
||||
imagesize = "100";
|
||||
}
|
||||
|
||||
if (imagesize != "100")
|
||||
{
|
||||
int newWidth = img.Width / 100 * Convert.ToInt32(imagesize);
|
||||
int newHeight = img.Height / 100 * Convert.ToInt32(imagesize);
|
||||
img = new Bitmap(img, new Size(newWidth, newHeight));
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
WPicture picture = paragraph.AppendPicture(img) as WPicture;
|
||||
IWSection section = document.Sections[0];
|
||||
|
||||
@@ -1309,6 +1329,8 @@ namespace DOCGEN.Klassen
|
||||
string formattype = "";
|
||||
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
|
||||
WordDocument document = new WordDocument(ms, FormatType.Automatic);
|
||||
document.MailMerge.ClearFields = false;
|
||||
|
||||
CompatibilityMode compatibilityMode = document.Settings.CompatibilityMode;
|
||||
|
||||
set_compatibilitymode(ref document, docdata.CompatibilityMode);
|
||||
@@ -1708,7 +1730,54 @@ namespace DOCGEN.Klassen
|
||||
WordDocumentPart htmlDocumentPart = ConvertHTMLToWordDocumentPart(apivalue.Value);
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
bookmarkNavigator.MoveToBookmark(apivalue.Tag);
|
||||
|
||||
//foreach (WSection s in htmlDocumentPart.Sections)
|
||||
//{
|
||||
// foreach (WParagraph p in s.Paragraphs)
|
||||
// {
|
||||
// foreach (Entity t in p.ChildEntities)
|
||||
// {
|
||||
// if (t is WTextRange)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// WTextRange textRange = t as WTextRange;
|
||||
// textRange.CharacterFormat.FontName = "Futura Book";
|
||||
// textRange.CharacterFormat.FontSize = 10;
|
||||
|
||||
// }
|
||||
// catch { }
|
||||
// }
|
||||
// if (t is WTable)
|
||||
// {
|
||||
// WTable table = t as WTable;
|
||||
// foreach (WTableRow row in table.Rows)
|
||||
// {
|
||||
// // Iterate through each cell in the row.
|
||||
// foreach (WTableCell cell in row.Cells)
|
||||
// {
|
||||
// // Iterate through each paragraph in the cell.
|
||||
// foreach (WParagraph paragraph in cell.Paragraphs)
|
||||
// {
|
||||
// // Iterate through the child entities of the paragraph.
|
||||
// foreach (Entity entity in paragraph.ChildEntities)
|
||||
// {
|
||||
// // Check if the child entity is a text range.
|
||||
// if (entity is WTextRange)
|
||||
// {
|
||||
// // Change the font to Algerian for the text range.
|
||||
// (entity as WTextRange).CharacterFormat.FontName = "Futura Book";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
bookmarkNavigator.ReplaceContent(htmlDocumentPart);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user