This commit is contained in:
2008-11-19 13:53:59 +00:00
parent f4daddd0d4
commit dd571890fc
5 changed files with 49 additions and 19 deletions

View File

@@ -26,9 +26,9 @@ namespace DataLoader
{
public partial class Loader
{
private void SaveSectionDocument(string fname, string stpseq, ref int cid)
private void SaveSectionDocument(string fname, string stpseq, string stype, ref int cid)
{
int docid = SaveWordDoc(fname);
int docid = SaveWordDoc(fname, stype);
switch (docid)
{
case 0:
@@ -44,7 +44,8 @@ namespace DataLoader
break;
}
}
private int SaveWordDoc(string fname, string title, ConfigInfo ci)
private int SaveWordDoc(string fname, string title, string stype, ConfigInfo ci)
{
int docid = 0;
if (System.IO.File.Exists(fname))
@@ -52,6 +53,31 @@ namespace DataLoader
if (frmMain.cbSaveDocChecked)
{
WordDoc d = new WordDoc(fname);
/* 16-bit's type[1] used the following codes to represent the respective lpi setting
*
* char far typestr[] = "*pP46f7L";
*
* char * far printtypes[] = {
* "Compressed, 8 lines per inch",
* "Elite, 6 lines per inch",
* "Pica, 6 lines per inch",
* "Default font, 4 Lines Per Inch",
* "Default font, 6 Lines Per Inch",
* "Compressed 6 LPI",
* "Default font, 7 Lines Per Inch",
* "Special Landscape, Elite, 6 lines per inch"
*/
if (stype != null)
{
// stype[1] == 'p' or 'P' or '6' 'f' or 'L' get spc = 6
int lpi = 6;
if (stype[1] == '*') lpi = 8;
else if (stype[1] == '4') lpi = 4;
else if (stype[1] == '7') lpi = 7;
// if need landscape set too: bool landscape = (stype[1] == 'L');
d.SetLineSpacing(lpi); // if need landscape set too: , landscape); ;
}
string temppath = Path.GetTempFileName();
string s = d.Save(temppath);
d.Close();
@@ -69,9 +95,9 @@ namespace DataLoader
log.ErrorFormat("Missing rtf file: {0}", fname);
return docid;
}
private int SaveWordDoc(string temppath)
private int SaveWordDoc(string temppath, string stype)
{
return SaveWordDoc(temppath, String.Empty, null);
return SaveWordDoc(temppath, String.Empty, stype, null);
}
private int SaveTheDoc(string temppath, string title, ConfigInfo ci)
{