/// <summary> /// Delete Image signature from the document. /// </summary> public static void Run() { Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------"); Console.WriteLine("[Example Basic Usage] # DeleteImage : Delete Image signature from the document \n"); // The path to the documents directory. string filePath = Constants.SAMPLE_SIGNED_MULTI; string fileName = Path.GetFileName(filePath); // copy source file since Delete method works with same Document string outputFilePath = Path.Combine(Constants.OutputPath, "DeleteImage", fileName); Constants.CheckDir(outputFilePath); File.Copy(filePath, outputFilePath, true); using (Signature signature = new Signature(outputFilePath)) { ImageSearchOptions options = new ImageSearchOptions(); // search for image signatures in document List <ImageSignature> signatures = signature.Search <ImageSignature>(options); if (signatures.Count > 0) { ImageSignature imageSignature = signatures[0]; bool result = signature.Delete(imageSignature); if (result) { Console.WriteLine($"Image signature at location {imageSignature.Left}x{imageSignature.Top} and Size {imageSignature.Size}' was deleted from document ['{fileName}']."); } else { Helper.WriteError($"Signature was not deleted from the document! Signature at location {imageSignature.Left}x{imageSignature.Top} and Size {imageSignature.Size} was not found!"); } } } }
public void Upsvc_Match_Wildcard() { var image = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x12, 0x34, 0x56, 0x00 }; var sig = new ImageSignature { EntryPointPattern = "??34" }; var upsvc = new UnpackingService(sc); Assert.IsTrue(upsvc.Matches(sig, image, 4)); }
/// <summary> /// Update Image signature in the document by known SignatureId /// SignatureId could be obtained by Search or Sign method /// </summary> public static void Run() { Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------"); Console.WriteLine("[Example Advanced Usage] # UpdateImageById : Update Image signature in the document by known SignatureId\n"); // The path to the documents directory. string filePath = Constants.SAMPLE_SIGNED_MULTI; // copy source file since Update method works with same Document string fileName = Path.GetFileName(filePath); string outputFilePath = Path.Combine(Constants.OutputPath, "UpdateImageById", fileName); Constants.CheckDir(outputFilePath); File.Copy(filePath, outputFilePath, true); // initialize Signature instance using (Signature signature = new Signature(outputFilePath)) { // read from some data source signature Id value string[] signatureIdList = new string[] { "e3ad0ec7-9abf-426d-b9aa-b3328f3f1470" }; // create list of Image Signature by known SignatureId List <BaseSignature> signatures = new List <BaseSignature>(); foreach (var item in signatureIdList) { ImageSignature temp = new ImageSignature(item); temp.Width = 150; temp.Height = 150; temp.Left = 200; temp.Top = 200; signatures.Add(temp); } // update all found signatures UpdateResult updateResult = signature.Update(signatures); if (updateResult.Succeeded.Count == signatures.Count) { Console.WriteLine("\nAll signatures were successfully updated!"); } else { Console.WriteLine($"Successfully updated signatures : {updateResult.Succeeded.Count}"); Helper.WriteError($"Not updated signatures : {updateResult.Failed.Count}"); } Console.WriteLine("List of updated signatures:"); foreach (BaseSignature temp in updateResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } }
/// <summary> /// Update Image signature from the document. /// </summary> public static void Run() { Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------"); Console.WriteLine("[Example Basic Usage] # UpdateImage : Update Image signature from the document \n"); // The path to the documents directory. string filePath = Constants.SAMPLE_SIGNED_MULTI; // copy source file since Update method works with same Document string fileName = Path.GetFileName(filePath); string outputFilePath = Path.Combine(Constants.OutputPath, "UpdateImage", fileName); Constants.CheckDir(outputFilePath); File.Copy(filePath, outputFilePath, true); // initialize Signature instance using (Signature signature = new Signature(outputFilePath)) { ImageSearchOptions options = new ImageSearchOptions(); // search for image signatures in document List <ImageSignature> signatures = signature.Search <ImageSignature>(options); if (signatures.Count > 0) { ImageSignature imageSignature = signatures[0]; // change position imageSignature.Left = 200; imageSignature.Top = 250; // change size. Please note not all documents support changing signature size imageSignature.Width = 200; imageSignature.Height = 200; bool result = signature.Update(imageSignature); if (result) { Console.WriteLine($"Image signature at location {imageSignature.Left}x{imageSignature.Top} and Size {imageSignature.Size}' was updated in the document ['{fileName}']."); } else { Helper.WriteError($"Signature was not updated in the document! Signature at location {imageSignature.Left}x{imageSignature.Top} and Size {imageSignature.Size} was not found!"); } } } }
private float m_fltDrawStrAtRectangle(bool p_blnIsMeasureH, float col1, float col2, string strPrint, float LocationY, int signflg, System.Drawing.Printing.PrintPageEventArgs e) { RectangleF rect = new RectangleF(col1, LocationY + 2, col2 - col1, m_ftlRowHeight); System.Drawing.Font m_font = this.m_fontBody; SizeF s = e.Graphics.MeasureString(strPrint, m_font, Convert.ToInt32(rect.Width));//字宽 if (s.Height > rect.Height && p_blnIsMeasureH) { m_font = new System.Drawing.Font("宋体", 9); s = e.Graphics.MeasureString(strPrint, m_font, Convert.ToInt32(rect.Width)); if (s.Height > rect.Height) { rect.Height = s.Height + 6; } } else if (s.Height > rect.Height) { rect.Height = s.Height + 6; } StringFormat sf = new StringFormat(StringFormatFlags.FitBlackBox); sf.Alignment = StringAlignment.Center; if (signflg == 1) { Image imgEmpSig = ImageSignature.GetEmpSigImage(strPrint); if (imgEmpSig != null) { e.Graphics.DrawImage(imgEmpSig, (int)enmRectangleInfo.LeftX + 690, LocationY + 2, 60, 26); } else { e.Graphics.DrawString(strPrint, m_font, this.m_objBrush, rect, sf); } } else { e.Graphics.DrawString(strPrint, m_font, this.m_objBrush, rect, sf); } return(rect.Height); }
// 打印页 private void m_mthPrintPageSub(PrintPageEventArgs e) { e.HasMorePages = false; m_mthPrintTitleInfo(e); Font fntNormal = new Font("SimSun", 12); if (m_intPages == 1) { m_intYPos += (int)enmRectangleInfo.RowStep - 20; } e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY); while (m_objPrintContext.m_BlnHaveMoreLine) { m_objPrintContext.m_mthPrintNextLine(ref m_intYPos, e.Graphics, fntNormal); if (m_intYPos >= (int)enmRectangleInfo.BottomY && m_objPrintContext.m_BlnHaveMoreLine) { #region 换页处理 e.HasMorePages = true; e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.LeftX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.RightX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, m_intYPos, (int)enmRectangleInfo.RightX, m_intYPos); m_intPages++; m_intYPos = (int)enmRectangleInfo.TopY + 10; clsPrintLine2.m_blnSinglePage = false; return; #endregion 换页处理 } } #region 最后一页处理 m_intYPos += 30; string strMainName = " "; string strDocName = ""; if (m_objRecordContent != null) { com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain objEmployeeSign = new com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain(); clsEmrEmployeeBase_VO objEmpVO = null; objEmployeeSign.m_lngGetEmpByNO(m_objRecordContent.m_strMainDoctorID, out objEmpVO); if (objEmpVO != null) { strMainName = objEmpVO.m_strLASTNAME_VCHR; } objEmployeeSign.m_lngGetEmpByNO(m_objRecordContent.m_strDoctorID, out objEmpVO); if (objEmpVO != null) { strDocName = objEmpVO.m_strLASTNAME_VCHR; } } e.Graphics.DrawString("主治医师:", new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 300, m_intYPos); Image imgEmpSig = ImageSignature.GetEmpSigImage(strMainName); if (imgEmpSig != null) { //imgEmpSig = ImageSignature.pictureProcess(imgEmpSig, 579, 268); e.Graphics.DrawImage(imgEmpSig, (int)enmRectangleInfo.LeftX + 380, m_intYPos - 2, 70, 30); } else { e.Graphics.DrawString(strMainName, m_fotSmallFont, Brushes.Black, (int)enmRectangleInfo.LeftX + 380, m_intYPos); } e.Graphics.DrawString(" 医师签名:", new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 450, m_intYPos); imgEmpSig = ImageSignature.GetEmpSigImage(strDocName); if (imgEmpSig != null) { //imgEmpSig = ImageSignature.pictureProcess(imgEmpSig, 579, 268); e.Graphics.DrawImage(imgEmpSig, (int)enmRectangleInfo.LeftX + 580, m_intYPos - 2, 70, 30); } else { e.Graphics.DrawString(strDocName, m_fotSmallFont, Brushes.Black, (int)enmRectangleInfo.LeftX + 580, m_intYPos); } // m_intYPos+=25; // e.Graphics.DrawString("工 号:",new Font("SimSun",12) ,Brushes.Black,(int)enmRectangleInfo.LeftX+560,m_intYPos); // if(m_objRecordContent!=null) // e.Graphics.DrawString(m_objRecordContent.m_strDoctorID,new Font("SimSun",12) ,Brushes.Black,(int)enmRectangleInfo.LeftX+560+(int)(5f*17.5f),m_intYPos); /////////////////////////////////******************************************* m_intYPos += 50; if (m_intYPos < (int)enmRectangleInfo.BottomY) { m_intYPos = (int)enmRectangleInfo.BottomY; } e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.LeftX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.RightX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, m_intYPos, (int)enmRectangleInfo.RightX, m_intYPos); #endregion 最后一页处理 m_intYPos += (int)enmRectangleInfo.RowStep + 15; Font fntSign = new Font("", 6); while (m_objPrintContext.m_BlnHaveMoreSign) { m_objPrintContext.m_mthPrintNextSign((int)enmRectangleInfo.LeftX, m_intYPos, e.Graphics, fntSign); m_intYPos += (int)enmRectangleInfo.RowStep - 10; } //全部打完 m_objPrintContext.m_mthReset(); m_intPages = 1; m_intYPos = (int)enmRectangleInfo.TopY; }
/// <summary> /// Following example shows how to process Image Signature over all signature life-cycle. /// First document is being signed with Image Signature, then verified for it, searched for same, updating and finally deleting this signature. /// </summary> public static void Run() { Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------"); Console.WriteLine("[Example Advanced Usage] # ProcessingImageSignatureOverCRUD : Process Image Signature over all signature life-cycle\n"); // The path to the documents directory. string filePath = Constants.SAMPLE_WORDPROCESSING; string fileName = Path.GetFileName(filePath); string outputFilePath = Path.Combine(Constants.OutputPath, "ProcessingImageSignatureOverCRUD", fileName); List <string> signatureIds = new List <string>(); // ----------------------------------------------------------------------------------------------------------------------------- // STEP 1. Sign document with Image Signature // ----------------------------------------------------------------------------------------------------------------------------- using (Signature signature = new Signature(filePath)) { ImageSignOptions signOptions = new ImageSignOptions(Constants.ImageStamp) { VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Center, Width = 100, Height = 40, Margin = new Padding(20) }; // sign document to file SignResult signResult = signature.Sign(outputFilePath, signOptions); Console.WriteLine("\nDocument {filePath} was signed with following signatures:"); foreach (BaseSignature temp in signResult.Succeeded) { // collect newly created signature' Id signatureIds.Add(temp.SignatureId); Console.WriteLine($"Signature : {temp.SignatureType} Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } // ----------------------------------------------------------------------------------------------------------------------------- // STEP 2. Search document for Image Signature // ----------------------------------------------------------------------------------------------------------------------------- using (Signature signature = new Signature(outputFilePath)) { ImageSearchOptions searchOptions = new ImageSearchOptions() { // specify special pages to search on AllPages = true }; // search for image signatures in document List <ImageSignature> signatures = signature.Search <ImageSignature>(searchOptions); Console.WriteLine("\nSource document contains following Image signature(s)."); // enumerate all signature for output foreach (ImageSignature imageSignature in signatures) { if (imageSignature != null) { Console.WriteLine($"Found Image signature at page {imageSignature.PageNumber} and Image Size '{imageSignature.Size}'."); Console.WriteLine($"Location at {imageSignature.Left}-{imageSignature.Top}. Size is {imageSignature.Width}x{imageSignature.Height}."); } } // ----------------------------------------------------------------------------------------------------------------------------- // STEP 3. Update document Image Signature after searching it // ----------------------------------------------------------------------------------------------------------------------------- foreach (ImageSignature imageSignature in signatures) { // change position imageSignature.Left = imageSignature.Left + 100; imageSignature.Top = imageSignature.Top + 100; // change size. Please note not all documents support changing signature size imageSignature.Width = 200; imageSignature.Height = 50; } List <BaseSignature> signaturesToUpdate = signatures.ConvertAll(p => (BaseSignature)p); UpdateResult updateResult; updateResult = signature.Update(signaturesToUpdate); if (updateResult.Succeeded.Count == signatures.Count) { Console.WriteLine("\nAll signatures were successfully updated!"); } else { Console.WriteLine($"Successfully updated signatures : {updateResult.Succeeded.Count}"); Helper.WriteError($"Not updated signatures : {updateResult.Failed.Count}"); } Console.WriteLine("List of updated signatures:"); foreach (BaseSignature temp in updateResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } // ----------------------------------------------------------------------------------------------------------------------------- // STEP 4. Update document Image Signature on saved SignatureId // create list of Image Signature by known SignatureId // ----------------------------------------------------------------------------------------------------------------------------- signaturesToUpdate.Clear(); foreach (var item in signatureIds) { ImageSignature temp = new ImageSignature(item) { Width = 150, Height = 30, Left = 100, Top = 100 }; signaturesToUpdate.Add(temp); } // update all found signatures updateResult = signature.Update(signaturesToUpdate); if (updateResult.Succeeded.Count == signatures.Count) { Console.WriteLine("\nAll signatures were successfully updated!"); } else { Console.WriteLine($"Successfully updated signatures : {updateResult.Succeeded.Count}"); Helper.WriteError($"Not updated signatures : {updateResult.Failed.Count}"); } Console.WriteLine("List of updated signatures:"); foreach (BaseSignature temp in updateResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } // ----------------------------------------------------------------------------------------------------------------------------- // STEP 5. Delete document Image Signature by id // create list of Image Signature by known SignatureId signaturesToUpdate.Clear(); foreach (var item in signatureIds) { ImageSignature temp = new ImageSignature(item); signaturesToUpdate.Add(temp); } // delete all signatures DeleteResult deleteResult = signature.Delete(signaturesToUpdate); if (deleteResult.Succeeded.Count == signaturesToUpdate.Count) { Console.WriteLine("\nAll signatures were successfully deleted!"); } else { Console.WriteLine($"Successfully deleted signatures : {deleteResult.Succeeded.Count}"); Helper.WriteError($"Not deleted signatures : {deleteResult.Failed.Count}"); } Console.WriteLine("List of deleted signatures:"); foreach (BaseSignature temp in deleteResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } }
// 打印页 private void m_mthPrintPageSub(PrintPageEventArgs e) { e.HasMorePages = false; m_mthPrintTitleInfo(e); Font fntNormal = new Font("SimSun", 12); if (m_intPages == 1) { m_intYPos += (int)enmRectangleInfo.RowStep + 5; e.Graphics.DrawLine(m_LinePen, (int)enmRectangleInfo.LeftX, 206, (int)enmRectangleInfo.RightX, 206); e.Graphics.DrawLine(m_LinePen, (int)enmRectangleInfo.LeftX, 235, (int)enmRectangleInfo.RightX, 235); } e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY); while (m_objPrintContext.m_BlnHaveMoreLine) { m_objPrintContext.m_mthPrintNextLine(ref m_intYPos, e.Graphics, fntNormal); if (m_intYPos >= (int)enmRectangleInfo.BottomY && m_objPrintContext.m_BlnHaveMoreLine) { #region 换页处理 e.HasMorePages = true; e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.LeftX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.RightX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, m_intYPos, (int)enmRectangleInfo.RightX, m_intYPos); m_intPages++; m_intYPos = (int)enmRectangleInfo.TopY + 30; return; #endregion 换页处理 } } #region 最后一页处理 m_intYPos += 30; e.Graphics.DrawString("医师签名:", new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 460, m_intYPos); if (m_objRecordContent != null) { com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain objEmployeeSign = new com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain(); clsEmrEmployeeBase_VO objEmpVO = null; objEmployeeSign.m_lngGetEmpByNO(m_objRecordContent.m_strDoctorID, out objEmpVO); if (objEmpVO != null) { Image imgEmpSig = ImageSignature.GetEmpSigImage(objEmpVO.m_strLASTNAME_VCHR); if (imgEmpSig != null) { //imgEmpSig = ImageSignature.pictureProcess(imgEmpSig, 579, 268); e.Graphics.DrawString(objEmpVO.m_strTechnicalRank, new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 540, m_intYPos); e.Graphics.DrawImage(imgEmpSig, (int)enmRectangleInfo.LeftX + 620, m_intYPos - 2, 70, 30); } else { e.Graphics.DrawString(m_objRecordContent.m_strDoctorName, new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 460 + (int)(5f * 17.5f), m_intYPos); } } } m_intYPos += 25; if (m_intYPos < (int)enmRectangleInfo.BottomY) { m_intYPos = (int)enmRectangleInfo.BottomY; } e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.LeftX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY, (int)enmRectangleInfo.RightX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, m_intYPos, (int)enmRectangleInfo.RightX, m_intYPos); #endregion 最后一页处理 m_intYPos += (int)enmRectangleInfo.RowStep + 15; Font fntSign = new Font("", 6); while (m_objPrintContext.m_BlnHaveMoreSign) { m_objPrintContext.m_mthPrintNextSign((int)enmRectangleInfo.LeftX, m_intYPos, e.Graphics, fntSign); m_intYPos += (int)enmRectangleInfo.RowStep - 10; } //全部打完 m_objPrintContext.m_mthReset(); m_intPages = 1; m_intYPos = (int)enmRectangleInfo.TopY; }
private void m_mthPrintAllPage(System.Drawing.Printing.PrintPageEventArgs e, ref float p_objLocationY) { if (m_objResult == null) { return; } if (m_objResult.m_objPostPartumValues == null && m_objResult.m_objMannoValue == null) { return; } string print = ""; if (m_objResult.m_objPostPartumValues != null && m_objResult.m_objPostPartumValues.Length > 0) { if (m_intCurrentPageIndex == 1) { for (i = 0; i < m_objResult.m_objPostPartumValues.Length; i++) { for (intSub = 0; intSub < m_objResult.m_objPostPartumValues[i].m_objRecordArr.Length; intSub++) { #region draw one row float fltRealHeight = 0f; print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_dtmRecordDate.Date.ToString("yy/MM/dd"); float fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltFirstColLeft, this.m_fltSeconColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strPOSTPORTUM_NUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSeconColLeft, this.m_fltthColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strUTERUSBOTTOM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthColLeft, this.m_fltthirColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strUTERUSPINCH_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthirColLeft, this.m_fltFiveColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strMILKNUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltFiveColLeft, this.m_fltSixColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strBREASTBULGE_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSixColLeft, this.m_fltSenColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strNIPPLE_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSenColLeft, this.m_fltNigColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strDEWNUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNigColLeft, this.m_fltNiNeColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strDEWCOLOR_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNiNeColLeft, this.m_fltColLeft10, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strDEWFUCK_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft10, this.m_fltColLeft11, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strPERINEUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft11, this.m_fltColLeft12, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strBP_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft12, this.m_fltColLeft13, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strURINE_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft13, this.m_fltColLeft14, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strANNOTATIONS_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft14, this.m_fltColLeft15, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = ""; if (m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr != null && m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr.Length > 0) { //print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[0].objEmployee.m_strGetTechnicalRankAndName; print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[0].objEmployee.m_strLASTNAME_VCHR; for (int w1 = 1; w1 < m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr.Length; w1++) { //print += ";" + m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[w1].objEmployee.m_strGetTechnicalRankAndName; print += ";" + m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[w1].objEmployee.m_strLASTNAME_VCHR; } } fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft15, this.m_fltColLeft15 + m_fltCol15, print, p_objLocationY, 1, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); fltRealHeight = m_fltGetMaxValue(fltRealHeight, m_ftlRowHeight); m_mthDrawLines(e, fltRealHeight); m_mthPrintHLine(e.Graphics, p_objLocationY, fltRealHeight); p_objLocationY += fltRealHeight; #endregion //判断是否多页 if (Convert.ToInt32(p_objLocationY) >= e.MarginBounds.Bottom) { m_intCurrentPageIndex++; e.HasMorePages = true; m_mthPrintFoot(e); return; } } intSub = 0; } } else { int temp = i; #region draw one row for (; i < m_objResult.m_objPostPartumValues.Length; i++) { for (intSub = 0; intSub < m_objResult.m_objPostPartumValues[i].m_objRecordArr.Length; intSub++) { #region draw one row float fltRealHeight = 0f; print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_dtmCreateDate.Date.ToString("yy/MM/dd"); float fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltFirstColLeft, this.m_fltSeconColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strPOSTPORTUM_NUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSeconColLeft, this.m_fltthColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strUTERUSBOTTOM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthColLeft, this.m_fltthirColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strUTERUSPINCH_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltthirColLeft, this.m_fltFiveColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strMILKNUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltFiveColLeft, this.m_fltSixColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strBREASTBULGE_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSixColLeft, this.m_fltSenColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strNIPPLE_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltSenColLeft, this.m_fltNigColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strDEWNUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNigColLeft, this.m_fltNiNeColLeft, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strDEWCOLOR_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltNiNeColLeft, this.m_fltColLeft10, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strDEWFUCK_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft10, this.m_fltColLeft11, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strPERINEUM_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft11, this.m_fltColLeft12, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strBP_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft12, this.m_fltColLeft13, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strURINE_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft13, this.m_fltColLeft14, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].m_strANNOTATIONS_CHR_RIGHT; fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft14, this.m_fltColLeft15, print, p_objLocationY, 0, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); print = ""; if (m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr != null && m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr.Length > 0) { //print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[0].objEmployee.m_strGetTechnicalRankAndName; print = m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[0].objEmployee.m_strLASTNAME_VCHR; for (int w1 = 1; w1 < m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr.Length; w1++) { //print += ";" + m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[w1].objEmployee.m_strGetTechnicalRankAndName; print += ";" + m_objResult.m_objPostPartumValues[i].m_objRecordArr[intSub].objSignerArr[w1].objEmployee.m_strLASTNAME_VCHR; } } fltHeight = m_fltDrawStrAtRectangle(true, this.m_fltColLeft15, this.m_fltColLeft15 + m_fltCol15, print, p_objLocationY, 1, e); fltRealHeight = m_fltGetMaxValue(fltRealHeight, fltHeight); fltRealHeight = m_fltGetMaxValue(fltRealHeight, m_ftlRowHeight); #endregion m_mthDrawLines(e, fltRealHeight); m_mthPrintHLine(e.Graphics, p_objLocationY, fltRealHeight); p_objLocationY += fltRealHeight; //判断是否多页 if (Convert.ToInt32(p_objLocationY) >= e.MarginBounds.Bottom) { m_intCurrentPageIndex++; e.HasMorePages = true; m_mthPrintFoot(e); return; } } intSub = 0; } #endregion } } p_objLocationY += 20; #region if (m_objResult.m_objMannoValue != null) { if (!m_blnIsPrint1) { //判断是否多页 if ((Convert.ToInt32(p_objLocationY) + m_ftlRowHeight * 2) >= e.MarginBounds.Bottom) { m_intCurrentPageIndex++; e.HasMorePages = true; m_mthPrintFoot(e); return; } //string str = "附注:记录时间:"+m_objResult.m_objMannoValue.m_dtmRecordDate.ToString("yyyy年MM月dd日 HH:mm:ss")+Environment.NewLine // + " 产后24小时总出血量:" + m_objResult.m_objMannoValue.m_strTOTALBLOODNUM_CHR_RIGHT + "ml" + Environment.NewLine + " 会阴伤口拆线:外缝" // + m_objResult.m_objMannoValue.m_strSEWPIN_CHR_RIGHT + "针,愈合级别:" + m_objResult.m_objMannoValue.m_strPERIOD_CHR_RIGHT + "期"; string str = "附注:记录时间:" + m_objResult.m_objMannoValue.m_dtmRecordDate.ToString("yyyy年MM月dd日 HH:mm:ss") + Environment.NewLine + " 产后24小时总出血量:" + m_objResult.m_objMannoValue.m_strTOTALBLOODNUM_CHR_RIGHT + "ml" + Environment.NewLine + " 会阴情况:" + m_objResult.m_objMannoValue.m_strPERIOD_CHR_RIGHT; e.Graphics.DrawString(str, this.m_fontBody, this.m_objBrush, this.m_fltFirstColLeft, p_objLocationY + 5); m_blnIsPrint1 = true; p_objLocationY += this.m_ftlRowHeight * 3; } if (!m_blnIsPrint2) { string str = "特殊记录:(记录出院时情况或正常产后突发情况)" + Environment.NewLine + " " + m_objResult.m_objMannoValue.m_strESPECIALRECORD_CHR_RIGHT; RectangleF rect = new RectangleF(e.PageBounds.Left + 50, p_objLocationY, e.PageBounds.Right - (e.PageBounds.Left + 60), m_ftlRowHeight * 2); SizeF sz = e.Graphics.MeasureString(str, this.m_fontBody, Convert.ToInt32(rect.Width)); //判断是否多页 if ((Convert.ToInt32(p_objLocationY) + Convert.ToInt32(sz.Height)) >= e.MarginBounds.Bottom) { m_intCurrentPageIndex++; e.HasMorePages = true; m_mthPrintFoot(e); return; } if (sz.Height > rect.Height) { rect.Height = sz.Height; } e.Graphics.DrawString(str, this.m_fontBody, this.m_objBrush, rect); m_blnIsPrint2 = true; p_objLocationY += rect.Height + 10; } string m_strPrint = "记录人:"; e.Graphics.DrawString(m_strPrint, this.m_fontBody, this.m_objBrush, e.PageBounds.Left + 500, p_objLocationY); if (m_objResult.m_objMannoValue.objSignerArr != null && m_objResult.m_objMannoValue.objSignerArr.Length > 0) { clsEmrSigns_VO[] m_objSignArr = m_objResult.m_objMannoValue.objSignerArr; m_strPrint = ""; int x = e.PageBounds.Left + 560; for (int i = 0; i < m_objSignArr.Length; i++) { if (i < m_objSignArr.Length - 1) { Image imgEmpSig = ImageSignature.GetEmpSigImage(m_objSignArr[i].objEmployee.m_strLASTNAME_VCHR); if (imgEmpSig != null) { e.Graphics.DrawImage(imgEmpSig, e.PageBounds.Left + 560, p_objLocationY - 2, 70, 30); } else { e.Graphics.DrawString(m_objSignArr[i].objEmployee.m_strLASTNAME_VCHR, m_fontBody, m_objBrush, e.PageBounds.Left + 560, p_objLocationY); } } else { Image imgEmpSig = ImageSignature.GetEmpSigImage(m_objSignArr[i].objEmployee.m_strLASTNAME_VCHR); if (imgEmpSig != null) { e.Graphics.DrawImage(imgEmpSig, e.PageBounds.Left + 560, p_objLocationY - 2, 70, 30); } else { e.Graphics.DrawString(m_objSignArr[i].objEmployee.m_strLASTNAME_VCHR, m_fontBody, m_objBrush, e.PageBounds.Left + 560, p_objLocationY - 2); } } x += 80; } //e.Graphics.DrawString(m_strPrint, m_fontBody, m_objBrush, e.PageBounds.Left + 560, p_objLocationY); } m_mthPrintFoot(e); } #endregion }
public override void m_mthPrintNextLine(ref int p_intPosY, System.Drawing.Graphics p_objGrp, System.Drawing.Font p_fntNormalText) { if (m_objContent == null || m_objContent.m_objItemContents == null) { m_blnHaveMoreLine = false; return; } if (m_blnIsFirstPrint) { p_intPosY += 20; string strOperations = ""; string strAllText = ""; string strXml = ""; List <string> lstSignName = new List <string>(); List <string> lstSignRank = new List <string>(); if (m_objContent.objSignerArr != null) { for (int i = 0; i < m_objContent.objSignerArr.Length; i++) { if (m_objContent.objSignerArr[i].controlName == "m_lsvOperation") { strOperations += m_objContent.objSignerArr[i].objEmployee.m_strGetTechnicalRankAndName + " "; lstSignRank.Add(m_objContent.objSignerArr[i].objEmployee.m_strTechnicalRank); lstSignName.Add(m_objContent.objSignerArr[i].objEmployee.m_strLASTNAME_VCHR); } } } if (strOperations != "") { p_objGrp.DrawString("签名:", p_fntNormalText, Brushes.Black, m_intRecBaseX + 10, p_intPosY); int x = m_intRecBaseX + 100; //string strFirstName = new clsEmployee(m_objContent.m_strCreateUserID).m_StrFirstName; for (int sI = 0; sI < lstSignName.Count; sI++) { Image imgEmpSig = ImageSignature.GetEmpSigImage(lstSignName[sI]); if (imgEmpSig != null) { //imgEmpSig = ImageSignature.pictureProcess(imgEmpSig, 579, 268); p_objGrp.DrawString(lstSignRank[sI], p_fntNormalText, Brushes.Black, x, p_intPosY); x += 90; p_objGrp.DrawImage(imgEmpSig, x, p_intPosY - 5, 70, 30); x += 90; } else { p_objGrp.DrawString(lstSignRank[sI] + " " + lstSignName[sI], p_fntNormalText, Brushes.Black, x, p_intPosY); x += 180; } } //m_mthMakeText(new string[] { strOperations }, new string[] { "" }, ref strAllText, ref strXml); } else { m_blnHaveMoreLine = false; return; } m_objPrintContext.m_mthSetContextWithCorrectBefore(strAllText, strXml, m_dtmFirstPrintTime, m_objContent.m_objItemContents != null); m_blnIsFirstPrint = false; } if (m_objPrintContext.m_BlnHaveNextLine()) { m_objPrintContext.m_mthPrintLine((int)enmRectangleInfoInPatientCaseInfo.PrintWidth2 - 25, m_intRecBaseX + 60, p_intPosY, p_objGrp); p_intPosY += 20; } if (m_objPrintContext.m_BlnHaveNextLine()) { m_blnHaveMoreLine = true; } else { m_blnHaveMoreLine = false; } }
// 打印页 private void m_mthPrintPageSub(PrintPageEventArgs e) { e.HasMorePages = false; m_mthPrintTitleInfo(e); Font fntNormal = new Font("SimSun", 12); if (m_intPages == 1) { m_intYPos += (int)enmRectangleInfo.RowStep - 20; } e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY - 30, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY - 30); while (m_objPrintContext.m_BlnHaveMoreLine) { m_objPrintContext.m_mthPrintNextLine(ref m_intYPos, e.Graphics, fntNormal); if (m_intYPos >= (int)enmRectangleInfo.BottomY && m_objPrintContext.m_BlnHaveMoreLine) { #region 换页处理 e.HasMorePages = true; e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY - 30, (int)enmRectangleInfo.LeftX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY - 30, (int)enmRectangleInfo.RightX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, m_intYPos, (int)enmRectangleInfo.RightX, m_intYPos); // e.Graphics.DrawString("(第"+m_intPages.ToString()+"页)",m_fotSmallFont ,m_slbBrush,(int)enmRectangleInfo.LeftX+500 ,m_intYPos+20); m_intPages++; m_intYPos = (int)enmRectangleInfo.TopY - 20; clsPrintLine2.m_blnSinglePage = false; return; #endregion 换页处理 } } #region 最后一页处理 m_intYPos += 30; e.Graphics.DrawString("记录者:", new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 498, m_intYPos); if (m_objRecordContent != null) { // e.Graphics.DrawString(m_objRecordContent.m_strRecorderName, new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 560 + (int)(5f * 17.5f), m_intYPos); com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain objEmployeeSign = new com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain(); clsEmrEmployeeBase_VO objEmpVO = null; objEmployeeSign.m_lngGetEmpByNO(m_objRecordContent.m_strRecorderID, out objEmpVO); if (objEmpVO != null) { Image imgEmpSig = ImageSignature.GetEmpSigImage(objEmpVO.m_strLASTNAME_VCHR); if (imgEmpSig != null) { //imgEmpSig = ImageSignature.pictureProcess(imgEmpSig, 579, 268); e.Graphics.DrawString(objEmpVO.m_strTechnicalRank, new Font("SimSun", 12, FontStyle.Bold), Brushes.Black, (int)enmRectangleInfo.LeftX + 560, m_intYPos); e.Graphics.DrawImage(imgEmpSig, (int)enmRectangleInfo.LeftX + 650, m_intYPos - 5, 70, 30); } else { if (!(string.IsNullOrEmpty(objEmpVO.m_strGetTechnicalRankAndName))) { e.Graphics.DrawString(objEmpVO.m_strGetTechnicalRankAndName, new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 498 + (int)(5f * 17.5f), m_intYPos); } } } } m_intYPos += 30; e.Graphics.DrawString("主持人审阅签名:", new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 430, m_intYPos); if (m_objRecordContent != null) { //e.Graphics.DrawString(m_objRecordContent.m_strCompereSignName, new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 560 + (int)(5f * 17.5f), m_intYPos); com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain objEmployeeSign = new com.digitalwave.emr.BEDExplorer.clsHospitalManagerDomain(); clsEmrEmployeeBase_VO objEmpVO = null; objEmployeeSign.m_lngGetEmpByNO(m_objRecordContent.m_strCompereSignID, out objEmpVO); if (objEmpVO != null) { Image imgEmpSig = ImageSignature.GetEmpSigImage(objEmpVO.m_strLASTNAME_VCHR); if (imgEmpSig != null) { //imgEmpSig = ImageSignature.pictureProcess(imgEmpSig, 579, 268); e.Graphics.DrawString(objEmpVO.m_strTechnicalRank, new Font("SimSun", 12, FontStyle.Bold), Brushes.Black, (int)enmRectangleInfo.LeftX + 560, m_intYPos); e.Graphics.DrawImage(imgEmpSig, (int)enmRectangleInfo.LeftX + 650, m_intYPos - 5, 70, 30); } else { if (!(string.IsNullOrEmpty(objEmpVO.m_strGetTechnicalRankAndName))) { e.Graphics.DrawString(objEmpVO.m_strGetTechnicalRankAndName, new Font("SimSun", 12), Brushes.Black, (int)enmRectangleInfo.LeftX + 500 + (int)(5f * 15.5f), m_intYPos); } } } } m_intYPos += 25; if (m_intYPos < (int)enmRectangleInfo.BottomY) { m_intYPos = (int)enmRectangleInfo.BottomY; } e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, (int)enmRectangleInfo.TopY - 30, (int)enmRectangleInfo.LeftX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.RightX, (int)enmRectangleInfo.TopY - 30, (int)enmRectangleInfo.RightX, m_intYPos); e.Graphics.DrawLine(m_GridPen, (int)enmRectangleInfo.LeftX, m_intYPos, (int)enmRectangleInfo.RightX, m_intYPos); // e.Graphics.DrawString("(第"+m_intPages.ToString()+"页)",m_fotSmallFont ,m_slbBrush,(int)enmRectangleInfo.LeftX+350 ,m_intYPos+20); #endregion 最后一页处理 m_intYPos += (int)enmRectangleInfo.RowStep + 15; Font fntSign = new Font("", 6); while (m_objPrintContext.m_BlnHaveMoreSign) { m_objPrintContext.m_mthPrintNextSign((int)enmRectangleInfo.LeftX, m_intYPos, e.Graphics, fntSign); m_intYPos += (int)enmRectangleInfo.RowStep - 10; } //全部打完 m_objPrintContext.m_mthReset(); m_intPages = 1; m_intYPos = (int)enmRectangleInfo.TopY; }