目前,我无法生成一个不错的pdf与体面的书签和目录。
理想情况下,我希望有一个如下所示的pdf文档:
第1页(标题页,肖像方向)
第2页(目录,肖像方向)
第3页和进一步(分类别的所有表格,景观方向)
我的基本方法是:
options orientation=portrait nocenter nodate nonumber;
ods pdf file="C:\xyz.pdf" style=sasweb;
ods escapechar='^';
/* Title page */
title;
ods pdf text="^S={just=c} ^20n Document XYZ";
/* ---------- */
/* Table of contents */
ods pdf startpage=now;
title "Contents";
ods pdf text="Classes A & B";
ods pdf text="^S={URL='#Tab1'} Table 1: Class A";
ods pdf text="^S={URL='#Tab2'} Table 2: Class B";
ods pdf text="Classes C & D";
ods pdf text="^S={URL='#Tab3'} Table 3: Class C";
ods pdf text="^S={URL='#Tab4'} Table 4: Class D";
/* ----------------- */
ods pdf startpage=now; /* Start new page ... */
ods pdf startpage=no; /* ... and define no pagination */
title;
options orientation=landscape;
/* Table list */
%macro make_table(in_data=,title=,link=);
ods pdf anchor="&link";
ods proclabel="&title";
ods pdf text="^2n &title";
proc print data=&in_data contents='' noobs;
run;
%mend;
ods pdf text="Classes A & B";
/* Table 1 */
%make_table(in_data=sashelp.class,title=Table 1: Class A,link=Tab1);
/* Table 2 */
%make_table(in_data=sashelp.class,title=Table 2: Class B,link=Tab2);
ods pdf startpage=now;
ods pdf text="Classes C & D";
/* Table 3 */
%make_table(in_data=sashelp.class,title=Table 3: Class C,link=Tab3);
/* Table 4 */
%make_table(in_data=sashelp.class,title=Table 4: Class D,link=Tab4);
/* ---------- */
ods pdf close;在所有这些设置中,我遇到了几个问题:
这很可能是因为我对输出交付系统缺乏经验,但我现在为这些看似简单的问题挣扎了几个小时。希望有人能帮我。
发布于 2016-06-07 13:53:49
经过多次尝试和错误之后,我终于找到了一种适合我的方法。我不会发布整个解决方案,因为它相对较长,但总之,我做了以下工作:
而不是这样:
ods pdf text="^S={URL='#Tab1'} ...
ods pdf text="^S={URL='#Tab2'} ...我用这个:
ods pdf text="^S={URL='#IDX'} ...
ods pdf text="^S={URL='#IDX1'} ...这样,我就不必使用ods pdf锚-声明,这在我看来是有缺陷的(目录中的链接错误)。
尽管如此,我仍然无法将子类别直接链接到标题,但只能链接到下表。不过,我没问题,所以我不会再试了。
如果有人对结果感兴趣,那么它就来了:链接
https://stackoverflow.com/questions/37525789
复制相似问题