2017-05-15 14 views
0

iTextSharpを使用して生成したAveryラベルを印刷しています。iTextSharpバーコード配置

    case 3: 
      case 6: 
      case 9: 
      case 12: 
      case 15: 
       //fmp first 
       iTextSharp.text.Chunk chunkFmp1 = new iTextSharp.text.Chunk(string.Format(" {0}\n", patient.FmpSsn)); 
       chunkFmp1.Font.SetFamily("Arial"); 
       chunkFmp1.Font.Size = fontsize; 
       contents.Add(chunkFmp1); 
       //name 
       iTextSharp.text.Chunk chunkName1 = new iTextSharp.text.Chunk(string.Format(" {0}\n", patient.PatientName)); 
       chunkName1.Font.SetFamily("Arial"); 
       chunkName1.Font.Size = fontsize; 
       contents.Add(chunkName1); 
       //data 
       iTextSharp.text.Chunk chunkData1 = new iTextSharp.text.Chunk(string.Format(" {0} {1} {2}\n", "SEX:" + patient.PatientSex.Substring(0, 1), "DOB:" + patient.PatientDobString, "AGE:" + patient.PatientAge)); 
       chunkData1.Font.SetFamily("Arial"); 
       chunkData1.Font.Size = fontsize; 
       contents.Add(chunkData1); 
       //data2 
       iTextSharp.text.Chunk chunkBranch1 = new iTextSharp.text.Chunk(string.Format(" {0} {1} {2} {3}\n", patient.BranchOfService, patient.BillingCode, patient.Rank, patient.ReligionName)); 
       chunkBranch1.Font.SetFamily("Arial"); 
       chunkBranch1.Font.Size = fontsize; 
       contents.Add(chunkBranch1); 
       break; 

そして次で結果は:

enter image description here

あなたはの方法すべてを見ることができる3列シートの最後の列が少し上を移動する必要がありましたので、私はいくつかのスペースを追加しましたテキストはバーコードではなく少し移動します。バーコードとテキストをどのように揃えますか?

答えて

0

私はバーコードの配置のための設定があることに気づかなかったと思います:

contents.Add(new iTextSharp.text.Chunk(image39, 28, 0)); 

これは28ピクセル以上のコードをプッシュすると思います(?)。

関連する問題