「テキストの背景色として使用」が適用されていない状態でアノテーションが印刷される

文書番号 : 37731     文書種別 : 制限事項     登録日 : 2015/01/27     最終更新日 : 2017/04/28
文書を印刷する
対象製品
LEADTOOLS 17.5J Document Imaging
発生環境
SP3、SP4
詳細
テキストアノテーションのプロパティダイアログの[ブラシ]タブで「ブラシを使用する」にチェックし、「テキストの背景色として使用」にチェックしている状態で印刷を行った場合、「テキストの背景色として使用」が適用されていない(背景色がアノテーションオブジェクト全体に適用される)状態で印刷されます。
回避方法
Realizeメソッドを使用して画像にアノテーションを描画して印刷する方法をご検討ください。
具体的には以下のような手順となります。
  1. アノテーション描画前の画像をコピーしておきます。
  2. Realizeメソッドによりアノテーションを描画します。
  3. 表示中のアノテーションを非表示にします。
  4. 印刷処理後、1.でコピーしたアノテーション描画前の画像を表示します。
  5. 非表示にしたアノテーションを再表示します。

[VB.NET]
' アノテーション描画前の描画をコピー
Dim TempImage As RasterImage = RasterImageViewer1.Image.CloneAll
' アノテーションを描画
annAutomationManager.Automations(0).Realize()

' アノテーションを非表示にする
For i As Integer = 0 To annAutomationManager.Automations(0).Container.Objects.Count - 1
  annAutomationManager.Automations(0).Container.Objects(i).Visible = False
Next

' === 印刷処理 ===
~ 省略 ~
printer.Print(RasterImageViewer1.Image, 1, annAutomationManager.Automations(0).Container, e)
' ============

' 印刷処理後、アノテーション描画前の描画を表示する
RasterImageViewer1.Image = TempImage

' アノテーションを再表示する
For i As Integer = 0 To annAutomationManager.Automations(0).Container.Objects.Count - 1
  annAutomationManager.Automations(0).Container.Objects(i).Visible = True
Next


[C#]
// アノテーション描画前の描画をコピー
RasterImage TempImage = rasterImageViewer1.Image.CloneAll();
// アノテーションを描画
annAutomationManager.Automations[0].Realize();

// アノテーションを非表示にする
for (int i = 0; i <= annAutomationManager.Automations[0].Container.Objects.Count - 1; i++)
{
  annAutomationManager.Automations[0].Container.Objects[i].Visible = false;
}

// === 印刷処理 ===
~ 省略 ~
printer.Print(rasterImageViewer1.Image, 1, annAutomationManager.Automations[0].Container, e);
// ============

// 印刷処理後、アノテーション描画前の描画を表示する
rasterImageViewer1.Image = TempImage;

// アノテーションを再表示する
for (int i = 0; i <= annAutomationManager.Automations[0].Container.Objects.Count - 1; i++)
{
  annAutomationManager.Automations[0].Container.Objects[i].Visible = true;
}