掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
印刷プレビューで (ID:3623)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
はじめまして。 印刷プレビューコンポーネントTplPrev(http://homepage2.nifty.com/Mr_XRAY/Delphi/plPrev/index.htm)を使って印刷プレビューし、ページ番号を入れようとしてもうまくいきません。 以下ソースです。 //////////////////////// var Li,Line,i:Integer; PageStr:String; begin plPrev.BeginDoc; plPrev.Canvas.Font:=CurrentEdit.Font; plPrev.Canvas.Font.Size:=CurrentEdit.Font.Size * 3; for Li:=1 to CurrentEdit.Lines.Count do begin plPrev.Canvas.TextOut(SpLeft,SpTop + ((CurrentEdit.Fontheight * 3 + (Gyokan - 5)) * Line),Memo1.Lines[Li]); Inc(Line); if (((CurrentEdit.Fontheight * 3 + (Gyokan - 5)) * Line) + SpTop + SpUnder + 100) >= (plPrev.PaperHeight) then begin plPrev.NewPage; Line:=0; plPrev.Canvas.Font:=CurrentEdit.Font; plPrev.Canvas.Font.Size:=CurrentEdit.Font.Size * 3; end; end; if Page=True then for i:=1 to plPrev.PageCount do begin plPrev.PageNumber:=i; PageStr:=IntToStr(i) + '/' + IntToStr(plPrev.PageCount); plPrev.Canvas.Font.Name:='MS Pゴシック'; plPrev.Canvas.Font.Size:=30; plPrev.Canvas.Font.Style:=[fsBold]; {if Ici='左上' then plPrev.TextOutLT(SpLeft,SpTop - 25,PageStr); if Ici='上' then plPrev.TextOutCT(plPrev.PaperWidth div 2,SpTop - 25,PageStr); if Ici='右上' then plPrev.TextOutRT(plPrev.PaperWidth - SpLeft,SpTop - 25,PageStr); if Ici='左下' then plPrev.TextOutLB(SpLeft,plPrev.PaperHeight - SpUnder,PageStr);} if Ici='下' then plPrev.TextOutCB(plPrev.PaperWidth div 2,plPrev.PaperHeight - SpUnder,PageStr); {if Ici='右下' then plPrev.TextOutRB(plPrev.PaperWidth - SpLeft,plPrev.PaperHeight - SpUnder,PageStr);} end; plPrev.Title:='プレビュー'; plPrev.EndDoc; plPrev.ShowModal; end; ////////////////////////////////////////// CurrentEditと、Memo1は別ですが、Memo1にCurrentEditの内容を入れてます。 if 文のところはあまり気にしないでください。 spLeft,spTop,spUnder,GyokanはIntegerです。 やってみると、うまく表示されません。 なぜでしょうか。 よろしくお願いします。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.