add text on 1st page of a pdf file

懵懂的女人 提交于 2019-12-06 12:26:05

Because your PostScript executed a showpage it ejects the first page after marking it, so the remaining content is therefore on the 2nd and subsequent pages. If you don;t execute showpage then the marks you make will be on the first page, and the first PDF page will be drawn 'on top' of it.

More complex code can use BeginPage and EndPage to draw over and under the page contents, and to do so on specified pages, among other things.

[added later]

Try this:

%!
<< 
/EndPage 
{
  0 eq
  {
    0 eq
    {
      /Arialabold findfont 22 scalefont setfont newpath 250 820 moveto 1 0 0 setrgbcolor (PAYE PAR CCP LE $DATEPMT) show
    } if
    true
  }
  {
    pop false
  } ifelse
} >> setpagedevice

Works for me.

You can do this directly to the PDF using the free cpdf command line tools:

For example,

cpdf -add-text "PAID on 5.1.2013" -topleft 100 -font "Helvetica" -font-size 30 in.pdf -o out.pdf
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!