Re: dvipdfm・・・

名前: 野田
日時: 2003-11-24 00:36:45
IPアドレス: 218.47.0.*

>>20624 だいぶ前の話な上に元質問者の方は既に解決済みのようですが… 古いソースから作成したDVIファイルをPDF化するのに,epsbox.styに対応する 必要に迫られたため,dvipdfmx用のepsbox.sty対応パッチを作成しました. 別解ということで,投稿しておきます. diff -ur dvipdfmx-20031110.orig/src/psspecial.c dvipdfmx-20031110/src/psspecial.c --- dvipdfmx-20031110.orig/src/psspecial.c 2002-10-30 11:27:16.000000000 +0900 +++ dvipdfmx-20031110/src/psspecial.c 2003-11-14 09:56:59.000000000 +0900 @@ -260,6 +260,53 @@ result = 1; /* Likewise */ do_raw_ps_special (&start, end, 1, block_pending?pending_x:x_user, block_pending?pending_y:y_user); + } else if (!strncmp (start, "postscriptbox", strlen("postscriptbox"))) { + char filename[256]; + double width, height; + + if (sscanf (start+13, "{%lfpt}{%lfpt}{%256[^}]}", + &width, &height, filename) == 3) { + struct xform_info *p = new_xform_info(); + + p -> width = width*72/72.27; + p -> height = height*72/72.27; + + { + FILE *image_file; + char *kpse_file_name; + char buf[256], *pos; + if ((kpse_file_name = kpse_find_pict (filename)) && + (image_file = MFOPEN (kpse_file_name, FOPEN_R_MODE))) { + while (fgets (buf, 256, image_file)) { + if ((pos = strstr(buf, "%%BoundingBox:" )) != NULL){ + double llx, lly, urx, ury; + + while (*pos++ != ':' ); + if (sscanf (pos, "%lf %lf %lf %lf", + &llx, &lly, &urx, &ury) == 4) { + p -> u_llx = llx; + p -> u_lly = lly; + p -> u_urx = urx; + p -> u_ury = ury; + p -> user_bbox = 1; + break; + } + } + } + MFCLOSE (image_file); + } + } + + if(p -> user_bbox && validate_image_xform_info (p)) { + pdf_obj *embeded; + embeded = embed_image (filename, p, x_user, y_user, NULL); + if (embeded) + pdf_release_obj (embeded); + result = 1; + } + + release_xform_info (p); + } } return result; }

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます)