1
/* $Header: /home/cvsroot/dvipdfmx/src/pdfdoc.c,v 1.41 2005/08/31 08:01:05 chofchof Exp $
1
/* $Header: /home/cvsroot/dvipdfmx/src/pdfdoc.c,v 1.45 2006/12/21 02:36:55 chofchof Exp $
3
3
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
487
/* auxiliary function to compute timezone offset on
488
systems that do not support the tm_gmtoff in struct tm,
489
or have a timezone variable. Such as i386-solaris. */
492
compute_timezone_offset()
494
const time_t now = time(NULL);
499
localtime_r(&now, &local);
501
return (mktime(&local) - mktime(&tm));
491
508
asn_date (char *date_string)
510
#ifndef HAVE_TIMEZONE
511
# ifdef HAVE_TM_GMTOFF
512
# define timezone (-bd_time->tm_gmtoff)
514
# define timezone (-compute_timezone_offset())
515
# endif /* not HAVE_TM_GMTOFF */
516
#endif /* not HAVE_TIMEZONE */
493
517
time_t current_time;
494
518
struct tm *bd_time;
495
#ifndef HAVE_TIMEZONE
497
#define timezone (bdtime->gm_toff)
500
#endif /* TM_GM_TOFF */
501
#endif /* HAVE_TIMEZONE */
503
520
time(¤t_time);
504
521
bd_time = localtime(¤t_time);
505
522
sprintf(date_string, "D:%04d%02d%02d%02d%02d%02d%+03ld'%02ld'",
506
523
bd_time->tm_year + 1900, bd_time->tm_mon + 1, bd_time->tm_mday,
507
524
bd_time->tm_hour, bd_time->tm_min, bd_time->tm_sec,
508
-timezone/3600, timezone % 3600);
525
(-timezone / 3600), (timezone % 3600) / 60);
510
527
return strlen(date_string);
1992
2009
pdf_doc *p = &pdoc;
1993
2010
pdf_page *currentpage;
1998
currentpage = LASTPAGE(p);
1999
contents = (p->pending_forms ?
2000
p->pending_forms->form.contents : currentpage->contents);
2002
tbuf_len = pdf_dev_flushtmatrix(&pending_tbuf);
2004
pdf_add_stream(contents, pending_tbuf, tbuf_len);
2012
if (p->pending_forms) {
2013
pdf_add_stream(p->pending_forms->form.contents, buffer, length);
2015
currentpage = LASTPAGE(p);
2016
pdf_add_stream(currentpage->contents, buffer, length);
2006
pdf_add_stream(contents, buffer, length);
2215
2226
PDF_XOBJECT_TYPE_FORM,
2216
2227
&info, pdf_ref_obj(form->contents));
2218
/* Must call pdf_dev_flushtmatrix(). */
2219
pdf_doc_add_page_content(NULL, 0);
2221
2229
p->pending_forms = fnode;
2246
2254
fnode = p->pending_forms;
2247
2255
form = &fnode->form;
2249
/* Must call pdf_dev_flushtmatrix(). */
2250
pdf_doc_add_page_content(NULL, 0);
2252
2257
pdf_dev_grestore_to(fnode->q_depth);