This commit is contained in:
Kathy Ruffing 2012-04-12 16:34:17 +00:00
parent 00dc6448c2
commit bd47329345
2 changed files with 36 additions and 7 deletions

View File

@ -404,8 +404,16 @@ namespace VEPROMS.CSLA.Library
pdfFile.Delete(); pdfFile.Delete();
Pdf.DeleteAll(doc.DocID); // clear the PDF table for DocID first Pdf.DeleteAll(doc.DocID); // clear the PDF table for DocID first
DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle; DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle;
SectionConfig sc = myItemInfo.ActiveSection.MyConfig as SectionConfig;
if (sc != null && sc.Section_WordMargin == "Y")
{
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) { ;}
}
else
{
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (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)) { ;} (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)myItemInfo.MSWordPageCount, buf)) { ;}
}
doc.UpdateDRoUsages(roids); doc.UpdateDRoUsages(roids);
doc.Save(); doc.Save();
} }
@ -514,8 +522,16 @@ namespace VEPROMS.CSLA.Library
using (Document doc = docInfo.Get()) using (Document doc = docInfo.Get())
{ {
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle; DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
if (sc != null && sc.Section_WordMargin == "Y")
{
using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) { ;}
}
else
{
using (Pdf myPdf1 = 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)) { ;} (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) { ;}
}
doc.UpdateDRoUsages(roids); doc.UpdateDRoUsages(roids);
doc.Save(); doc.Save();
} }
@ -577,9 +593,13 @@ namespace VEPROMS.CSLA.Library
} }
LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName, false); LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName, false);
try try
{
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
if (sc == null || sc.Section_WordMargin == "N")
{ {
AdjustMargins(myDocStyle, myDoc, true); AdjustMargins(myDocStyle, myDoc, true);
} }
}
catch (Exception ex) catch (Exception ex)
{ {
_MyLog.Error("Could not Adjust Margins", ex); _MyLog.Error("Could not Adjust Margins", ex);

View File

@ -69,8 +69,17 @@ namespace VEPROMS.CSLA.Library
while (count < 2) while (count < 2)
{ {
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle; DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
PdfInfo myPdf = Get(sect.MyContent.MyEntry.DocID, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
PdfInfo myPdf = null;
if (sc != null && sc.Section_WordMargin == "Y")
{
myPdf = Get(sect.MyContent.MyEntry.DocID, MSWordToPDF.DebugStatus, 0, 0, 0, 0);
}
else
{
myPdf = Get(sect.MyContent.MyEntry.DocID, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth); (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
}
if (myPdf != null) return myPdf; if (myPdf != null) return myPdf;
if (count > 0) return null; // Could not find or create a pdf if (count > 0) return null; // Could not find or create a pdf
MSWordToPDF.SetDocPdf(sect.MyContent.MyEntry.MyDocument, sect); MSWordToPDF.SetDocPdf(sect.MyContent.MyEntry.MyDocument, sect);