documentclass で指定した用紙サイズを /BleedBox, /TrimBox に展開したい

Re: documentclass で指定した用紙サイズを /BleedBox, /TrimBox に展開したい

- ヤバルゴ mdl.2 の投稿
返信数: 0
回答有り難うございます.

前田 さまの示された方法で解決いたしました.

Z. R. さま, 前田 さま,ありがとうございました.

(追記:前の投稿の際,敬称を付け忘れておりました.今は直っておりますが,Z. R. さまがご覧になられていましたら申し訳ございません.)


%---以下,うまく動いたときの記録
\documentclass[uplatex,dvipdfmx,ja=standard,magstyle=real]{bxjsarticle}

\usepackage{pgfmath}
\pgfmathsetmacro\bpPaperWidth{\paperwidth/72.27*72}
\pgfmathsetmacro\bpPaperHeight{\paperheight/72.27*72}

% 代入したい位置
% 用紙サイズを bp に変換した数値を自動で代入できると嬉しい
\usepackage{bophook}
\AtBeginPage{
  \special{pdf:put @thispage <<
    /BleedBox [0 0 \bpPaperWidth\space\bpPaperHeight]
    /TrimBox [0 0 \bpPaperWidth\space\bpPaperHeight]
  >>}
}

% 以下,おまけ
% 自力で改造しているので,間違っている可能性あり
\usepackage{datetime}
\renewcommand{\dateseparator}{-}
\title{My title}
\author{My name}
\date{\yyyymmdddate\today}

\AtBeginDvi{
  \special{pdf:tounicode UTF8-UTF16}
  \special{pdf:docinfo <<
    /Title (My title)
    /Subject (My subtitle)
    /Author (My name)
    /CreationDate (D:\pdfdate+09'00')
    /ModDate (D:\pdfdate+09'00')
    /Keywords (My keywords)
  >>}
}

\AtBeginDvi{
  \special{pdf:minorversion 3}
  \special{pdf:docinfo <<
    /Trapped /False
    /GTS_PDFXVersion (PDF/X-1:2001)
    /GTS_PDFXConformance (PDF/X-1a:2001)
  >>}
  \special{pdf:docview <<
    /OutputIntents [ <<
      /Type /OutputIntent
      /S /GTS_PDFX
      /OutputConditionIdentifier (JC200103)
      /OutputCondition (JC200103 (Japan Color 2001 Coated))
      /RegistryName (http://www.color.org)
    >> ]
  >>}
}

\begin{document}

\bpPaperWidth

\bpPaperHeight

\end{document}