This commit is contained in:
@@ -345,7 +345,7 @@ namespace VEPROMS.CSLA.Library
|
||||
pdfFile.Delete();
|
||||
Pdf.DeleteAll(doc.DocID); // clear the PDF table for DocID first
|
||||
DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle;
|
||||
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopRow, (int)myDocStyle.Layout.PageLength,
|
||||
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
|
||||
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)myItemInfo.MSWordPageCount, buf)) { ;}
|
||||
doc.UpdateDRoUsages(roids);
|
||||
doc.Save();
|
||||
@@ -455,7 +455,7 @@ namespace VEPROMS.CSLA.Library
|
||||
using (Document doc = docInfo.Get())
|
||||
{
|
||||
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
|
||||
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopRow, (int)myDocStyle.Layout.PageLength,
|
||||
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
|
||||
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) { ;}
|
||||
doc.UpdateDRoUsages(roids);
|
||||
doc.Save();
|
||||
@@ -534,25 +534,17 @@ namespace VEPROMS.CSLA.Library
|
||||
float width = 72 * Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) / 12.0F;
|
||||
int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier);
|
||||
float height = 72 * lines / 6.0F;
|
||||
//sel.MoveEnd(LBWdUnits.wdLine, lines);// The number of lines depends on the third parameter
|
||||
//sel.EndKey(LBWdUnits.wdLine, true);
|
||||
//sel.MoveEnd(LBWdUnits.wdCharacter, -1);
|
||||
//Console.WriteLine("Lines = {0}", lines);
|
||||
float x = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToTextBoundary);
|
||||
// 9.25 is the approximate offset of the base line of the font, i.e. doesn't include descender.
|
||||
float y = (float)sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary) + ((sel.Font.Size * 9.25F) / 12);
|
||||
sel.Text = "";
|
||||
// TODO: Need to create a temporary file for printing.
|
||||
// TODO: Need a way to eliminate the temporary file when done printing.
|
||||
// LBInlineShape shape = sel.InlineShapes.AddPicture(@"C:\Plant\HLP\VEHLP\ro\No1Seal.bmp");
|
||||
float x = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToPage);
|
||||
float y = (float)sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
//LBInlineShape shape = sel.InlineShapes.AddPicture(pngFile);
|
||||
LBRange myRange = sel.Paragraphs.First.Range;
|
||||
float yTop = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage);
|
||||
LBShape shape = myDoc.Shapes.AddPicture(roImageFile.MyFile.FullName, x, y - yTop, sel.Range);
|
||||
// LBInlineShape shape = sel.InlineShapes.AddPicture(roImageFile.MyFile.FullName);
|
||||
//Console.WriteLine("{0} Shape Width {1} Height {2}", val.Replace("\n", "','"), shape.Width, shape.Height);
|
||||
LBShape shape = myDoc.Shapes.AddPicture(roImageFile.MyFile.FullName, x, y, sel.Range);
|
||||
shape.RelativeVerticalPosition = LBWdRelativeVerticalPosition.wdRelativeVerticalPositionMargin;
|
||||
shape.Top = y; // Reset value after setting flag RelativeVerticalPosition
|
||||
shape.RelativeHorizontalPosition = LBWdRelativeHorizontalPosition.wdRelativeHorizontalPositionMargin;
|
||||
shape.Left = x;
|
||||
shape.Width = width;
|
||||
shape.Height = height;
|
||||
//Console.WriteLine("{0} Shape Width {1} Height {2}", val.Replace("\n", "','"), shape.Width, shape.Height);
|
||||
imageROTokenReplaced = true;
|
||||
}
|
||||
if (!imageROTokenReplaced)
|
||||
@@ -563,7 +555,6 @@ namespace VEPROMS.CSLA.Library
|
||||
try
|
||||
{
|
||||
val = val.Replace("`", "\xB0");
|
||||
//AddInfo("\tRO Found {0} = '{1}'", sel.Text, val);
|
||||
sel.Text = "";
|
||||
//float width = 72 * Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) / 12.0F;
|
||||
//float height = 72 * lines / 6.0F;
|
||||
@@ -628,7 +619,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
public static void AdjustMargins(DocStyle myDocStyle, LBDocumentClass myDoc, bool printingMode)
|
||||
{
|
||||
float newTop = (float)myDocStyle.Layout.TopRow;
|
||||
float newTop = (float)myDocStyle.Layout.TopMargin;
|
||||
float newLeft = (float)myDocStyle.Layout.LeftMargin;
|
||||
float newLength = (float)myDocStyle.Layout.PageLength;
|
||||
float newWidth = (float)myDocStyle.Layout.PageWidth;
|
||||
|
Reference in New Issue
Block a user