diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 9 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfdoc.c | 10 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/spc_pdfm.c | 31 |
3 files changed, 43 insertions, 7 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 9ade4162636..edcb59c9241 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,12 @@ +2020-07-02 Shunsaku Hirata <shunsaku.hirata74@gmail.com> + + * pdfdoc.c, spc_pdfm.c: Possible fix for a bug that pdf:btrans + inside pdf:bcontent and pdf:econtent does not work correctly. + Extend pdf:bann to accept a reference ID which can be used + later to refer the annotation dictionary object. When + line-breaks occur, it just points to the first annotation + dictionary of the line-breaking annotation series. + 2020-06-28 Shunsaku Hirata <shunsaku.hirata74@gmail.com> * dvi.[ch], spc_dvipdfmx.c, spc_pdfm.c, specials.[ch]: Two new diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c index 3cb44d3e7bc..3b5ac18661a 100644 --- a/Build/source/texk/dvipdfm-x/pdfdoc.c +++ b/Build/source/texk/dvipdfm-x/pdfdoc.c @@ -2797,6 +2797,8 @@ void pdf_doc_end_annot (void) { pdf_doc_break_annot(); + if (breaking_state.annot_dict) + pdf_release_obj(breaking_state.annot_dict); breaking_state.annot_dict = NULL; } @@ -2807,12 +2809,14 @@ pdf_doc_break_annot (void) double g = p->opt.annot_grow; if (breaking_state.dirty) { - pdf_obj *annot_dict; + pdf_obj *annot_dict, *annot_copy; pdf_rect rect; /* Copy dict */ - annot_dict = pdf_new_dict(); - pdf_merge_dict(annot_dict, breaking_state.annot_dict); + annot_dict = breaking_state.annot_dict; + annot_copy = pdf_new_dict(); + pdf_merge_dict(annot_copy, breaking_state.annot_dict); + breaking_state.annot_dict = annot_copy; rect = breaking_state.rect; rect.llx -= g; rect.lly -= g; diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 00971def266..02eb9f1c400 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -798,11 +798,15 @@ spc_handler_pdfm_annot (struct spc_env *spe, struct spc_arg *args) return 0; } -/* NOTE: This can't have ident. See "Dvipdfm User's Manual". */ +/* NOTE: This can't have ident. See "Dvipdfm User's Manual". + * 1 Jul. 2020: ident allowed (upon request) + * Only first annotation can be accessed in line break cases. + */ static int spc_handler_pdfm_bann (struct spc_env *spe, struct spc_arg *args) { struct spc_pdf_ *sd = &_pdf_stat; + char *ident = NULL; int error = 0; if (sd->annot_dict) { @@ -811,19 +815,31 @@ spc_handler_pdfm_bann (struct spc_env *spe, struct spc_arg *args) } skip_white(&args->curptr, args->endptr); + if (args->curptr[0] == '@') { + ident = parse_opt_ident(&args->curptr, args->endptr); + skip_white(&args->curptr, args->endptr); + } sd->annot_dict = parse_pdf_dict_with_tounicode(&args->curptr, args->endptr, &sd->cd); if (!sd->annot_dict) { spc_warn(spe, "Ignoring annotation with invalid dictionary."); + if (ident) + RELEASE(ident); return -1; } else if (!PDF_OBJ_DICTTYPE(sd->annot_dict)) { spc_warn(spe, "Invalid type: not a dictionary object."); pdf_release_obj(sd->annot_dict); sd->annot_dict = NULL; + if (ident) + RELEASE(ident); return -1; } - error = spc_begin_annot(spe, sd->annot_dict); + error = spc_begin_annot(spe, pdf_link_obj(sd->annot_dict)); + if (ident) { + spc_push_object(ident, pdf_link_obj(sd->annot_dict)); + RELEASE(ident); + } return error; } @@ -1006,6 +1022,7 @@ static int spc_handler_pdfm_btrans (struct spc_env *spe, struct spc_arg *args) { pdf_tmatrix M; + double x_user, y_user, xpos, ypos; transform_info ti; transform_info_clear(&ti); @@ -1013,10 +1030,16 @@ spc_handler_pdfm_btrans (struct spc_env *spe, struct spc_arg *args) return -1; } + /* btrans inside bcontent-econtent bug fix. + * I don't know if this is the only place needs to be fixed... + */ + pdf_dev_get_coord(&xpos, &ypos); + x_user = spe->x_user - xpos; + y_user = spe->y_user - ypos; /* Create transformation matrix */ pdf_copymatrix(&M, &(ti.matrix)); - M.e += ((1.0 - M.a) * spe->x_user - M.c * spe->y_user); - M.f += ((1.0 - M.d) * spe->y_user - M.b * spe->x_user); + M.e += ((1.0 - M.a) * x_user - M.c * y_user); + M.f += ((1.0 - M.d) * y_user - M.b * x_user); pdf_dev_gsave(); pdf_dev_concat(&M); |