mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
classic: PdfDraw: Signing field now can be multstyle/multiline
git-svn-id: svn://ultimatepp.org/upp/trunk@10369 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
53e2c5cc57
commit
7f94ff6478
4 changed files with 17 additions and 9 deletions
|
|
@ -969,8 +969,8 @@ String PdfDraw::Finish(const PdfSignatureInfo *sign)
|
|||
int signature_widget = -1;
|
||||
int p7s_start, p7s_end, pdf_length_pos;
|
||||
|
||||
int sign_page = Null;
|
||||
String sign_rect;
|
||||
int sign_page = Null;
|
||||
Rect sign_rect;
|
||||
|
||||
if(sign) {
|
||||
signature = BeginObj();
|
||||
|
|
@ -1016,8 +1016,12 @@ String PdfDraw::Finish(const PdfSignatureInfo *sign)
|
|||
<< Pt(u.rect.left) << ' ' << Pt(pgsz.cy - u.rect.bottom) << ' '
|
||||
<< Pt(u.rect.right) << ' ' << Pt(pgsz.cy - u.rect.top) << "]\n";
|
||||
if(u.url == "<<signature>>") {
|
||||
sign_page = pi;
|
||||
sign_rect = r;
|
||||
if(sign_page == pi)
|
||||
sign_rect.Union(u.rect);
|
||||
else {
|
||||
sign_page = pi;
|
||||
sign_rect = u.rect;
|
||||
}
|
||||
}
|
||||
else {
|
||||
url_ann.At(pi) << ' ' << BeginObj() << " 0 R";
|
||||
|
|
@ -1045,7 +1049,10 @@ String PdfDraw::Finish(const PdfSignatureInfo *sign)
|
|||
sign_page = 0;
|
||||
}
|
||||
else
|
||||
out << "/F 4 " << sign_rect;
|
||||
out << "/F 4 /Border[0 0 0]/Rect["
|
||||
<< Pt(sign_rect.left) << ' ' << Pt(pgsz.cy - sign_rect.bottom) << ' '
|
||||
<< Pt(sign_rect.right) << ' ' << Pt(pgsz.cy - sign_rect.top) << "]\n";
|
||||
|
||||
out << "/P " << signature_widget + 2 + sign_page << " 0 R\n" // next entry is Pages and then Page
|
||||
<< ">>\n";
|
||||
EndObj();
|
||||
|
|
|
|||
|
|
@ -370,7 +370,8 @@ public:
|
|||
PdfDraw(Size pgsz = Size(5100, 6600), bool pdfa = false) { Init(pgsz.cx, pgsz.cy, 0, pdfa); }
|
||||
};
|
||||
|
||||
String Pdf(const Array<Drawing>& report, Size pagesize, int margin, bool pdfa = false);
|
||||
String Pdf(const Array<Drawing>& report, Size pagesize, int margin, bool pdfa = false,
|
||||
const PdfSignatureInfo *sign = NULL);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ public:
|
|||
ReportWindow();
|
||||
};
|
||||
|
||||
String Pdf(Report& report, bool pdfa = false);
|
||||
String Pdf(Report& report, bool pdfa = false, const PdfSignatureInfo *sign = NULL);
|
||||
void Print(Report& r, PrinterJob& pd);
|
||||
bool DefaultPrint(Report& r, int i, const char *_name = t_("Report"));
|
||||
bool Print(Report& r, int i, const char *name = t_("Report"));
|
||||
|
|
|
|||
|
|
@ -210,11 +210,11 @@ ReportWindow::ReportWindow()
|
|||
pdf <<= THISBACK(Pdf);
|
||||
}
|
||||
|
||||
String Pdf(Report& report, bool pdfa)
|
||||
String Pdf(Report& report, bool pdfa, const PdfSignatureInfo *sgn)
|
||||
{
|
||||
return GetDrawingToPdfFn() && report.GetCount() ?
|
||||
(*GetDrawingToPdfFn())(report.GetPages(), report.GetPage(0).GetSize(),
|
||||
Nvl(report.GetMargins().x, 200), pdfa)
|
||||
Nvl(report.GetMargins().x, 200), pdfa, sgn)
|
||||
: String();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue