{"id":1715,"date":"2011-06-08T12:34:00","date_gmt":"2011-06-08T12:34:00","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/Hayek\/Jochen\/wp\/blog-en\/2011\/06\/08\/how-to-print-a-pdf-document-together-with-its-filename-in-its-upper-left-corner\/"},"modified":"2021-04-02T13:09:16","modified_gmt":"2021-04-02T11:09:16","slug":"how-to-print-a-pdf-document-together-with-its-filename-in-its-upper-left-corner","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2011\/06\/08\/how-to-print-a-pdf-document-together-with-its-filename-in-its-upper-left-corner\/","title":{"rendered":"how to print a PDF document together with its filename in its upper left corner?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is only a very special case of &#8220;<i>how to add text given on the command line to a PDF file?<\/i>&#8220;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If I don&#8217;t find a nice and read utility to do this,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>I will create an image file from the PDF file,<\/li><li>I will create another image file from that text string (ImageMagick, GraphicsMagic?!?),<\/li><li>and I will finally overlay them&nbsp;(ImageMagick, GraphicsMagic?!?).<\/li><\/ul>\n\n\n\n<div><a href=\"http:\/\/oreilly.com\/catalog\/9780596006556\/\">PDF Hacks<\/a>&#8216; Hack# 90 describes how to &#8220;<i>Superimpose PDF Pages<\/i>&#8220;; there is also a one-liner with pdftk for that:<\/div>\n\n\n\n<div>$ pdftk <i>mydoc.pdf<\/i> output <i>mydoc.marked.pdf<\/i> background <i>watermark.pdf<\/i><\/div>\n\n\n\n<div>&nbsp;<\/div>\n\n\n\n<div>I need to print like 200 rather similar (1-page) files, which look rather, rather similar, and I don&#8217;t want to guess the filename from the contents of the page, so I prefer to print the filename on the same page as the actual contents.\n<p>\u00a0<\/p>\n<p>Update 2011-07-04:<br \/>I am using <a href=\"http:\/\/www.eprg.org\/pdfcorner\/text2pdf\/\">text2pdf<\/a>\u00a0(a rather, rather simple tool) for this task (regard this as one logical line):<\/p>\n<p>$ echo &#8220;text to be printed into the upper left corner&#8221; | \/usr\/local\/text2pdf\/text2pdf -A4 -s10 -v12 | pdftk original_file output file_with_sth_in_its_upper_left_corner background &#8211;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is only a very special case of &#8220;how to add text given on the command line to a PDF file?&#8220; If I don&#8217;t find a nice and read utility to do this, I will create an image file from the PDF file, I will create another image file from that text string (ImageMagick, GraphicsMagic?!?), [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[423,426,666],"tags":[],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-pdf","category-pdftk","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-rF","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/1715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=1715"}],"version-history":[{"count":2,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/1715\/revisions"}],"predecessor-version":[{"id":11603,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/1715\/revisions\/11603"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}