/media/bill/PROJECTS/System_maintenance/Linux/pdftk notes.txt www.BillHowell.ca 08Aug2018 initial This is for pdf editing, etc NAME pdftk - A handy tool for manipulating PDF DESCRIPTION If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder- ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Use it to: * Merge PDF Documents or Collate PDF Page Scans * Split PDF Pages into a New Document * Rotate PDF Documents or Pages * Decrypt Input as Necessary (Password Required) * Encrypt Output as Desired * Fill PDF Forms with X/FDF Data and/or Flatten Forms * Generate FDF Data Stencils from PDF Forms * Apply a Background Watermark or a Foreground Stamp * Report PDF Metrics, Bookmarks and Metadata * Add/Update PDF Bookmarks or Metadata * Attach Files to PDF Pages or the PDF Document * Unpack PDF Attachments * Burst a PDF Document into Single Pages * Uncompress and Re-Compress Page Streams * Repair Corrupted PDF (Where Possible) **************************** Editing pdf files : see example "/media/bill/SWAPPER/bin/pdftk stream edit IJCNN PDF files.sh" process_directory() { d_inn="$d_base""$1" d_out="$d_temp""$1" cat "$template_bas" | sed "s//$2/" >"$template_tex" pdflatex -interaction nonstopmode -output-directory "$d_temp" -output-format pdf "$template_tex" "$template_pdf" ls -1 "$d_inn" | grep ".pdf" | tr \\n \\0 | xargs -0 -ILINE pdftk "$d_inn""LINE" multistamp "$template_pdf" output "$d_out""LINE" } ********************************* *************** 05Apr2019 paper #19503 find "XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE" BT /Artifact <>BDC /CS0 cs 0 scn /TT0 1 Tf 0.003 Tc -0.003 Tw 8 0 0 8 44.6 38.2 Tm (XXX)Tj 0 Tc 0 Tw (-)Tj 2.5 0 Td (X)Tj 0.725 0 Td (-)Tj 0.003 Tc -0.003 Tw 0.325 0 Td (XXXX)Tj 0 Tc 0 Tw (-)Tj 0.003 Tc -0.003 Tw 3.225 0 Td (XXXX)Tj 0 Tc 0 Tw (-)Tj 0.003 Tc -0.003 Tw 3.225 0 Td [(X/)6(XX/)6($X)3(X.00 \251)22(20X)6(X I)11(E)14(E)14(E)]TJ 0 Tc 0 Tw 11.775 0 Td ( )Tj EMC +-----+ # BT # /F24 8.9664 Tf 37.636 18.077 Td [(978-1-7281-1985-4/19/31.00)-342(\050c\0512019)-343(Europ)-28(ean)-343(Union)]TJ/F15 10.9091 Tf 265.637 -29.965 Td [(1)]TJ # ET *************** 04Apr2019 pdftk Erase exisiting footnotes examples from small set of test papers (initial submission papers) corresponding author : 19013, XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE : 19503 X I copied these to USgov directory (only files there) to do tests to "pdftk stream edit IJCNN PDF files - template.tex" added : \footnote{} before : >> see if this erases original footnotes. >> Nyet +-----+ Try : \footnote{} \fancyfoot[L]{} \fancyfoot[C]{} \fancyfoot[R]{} >> No good! see "/media/bill/PROJECTS/System_maintenance/tex/fancy.hdr" page 10 : \fancyhead{} % clear all header fields \fancyhead[RO,LE]{\textbf{The performance of new graduates}} \fancyfoot{} % clear all footer fields \fancyfoot[LE,RO]{\thepage} \fancyfoot[LO,CE]{From: K. Grant} \fancyfoot[CO,RE]{To: Dean A. Smith} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} +-----+ Try : \begin{document} \pagestyle{fancy} \setlength{\parindent}{0pt} \chead{} \lhead{} \rhead{} \footnote{} \fancyhead{} % clear all header fields \fancyfoot{} % clear all footer fields \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0.4pt} ~ \newpage +-----+ WOW!- note that setup comes BEFORE \begin{document} !! https://tex.stackexchange.com/questions/87768/headers-and-footers \usepackage[latin9]{inputenc} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{blindtext} % provides blindtext with sectioning %\usepackage{scrpage2} % header and footer for KOMA-Script, old version \usepackage{scrlayer-scrpage} % header and footer for KOMA-Script \clearscrheadfoot % deletes header/footer \pagestyle{scrheadings} % use following definitions for header/footer % definitions/configuration for the header \rehead[]{This is my name} % equal page, right position (inner) \lohead[]{This is my name} % odd page, left position (inner) \lehead[]{this is page \pagemark} % equal page, left (outer) position \rohead[]{this is page \pagemark} % definitions/configuration for the footer \cefoot[]{center of the footer!} % equal page, center position \cofoot[\pagemark]{\pagemark} % odd page, center position \begin{document} Try that, with \clearscrheadfoot : \documentclass[11pt]{article} \usepackage[margin=0.25in]{geometry} \usepackage{fancyhdr} \usepackage{textcomp} \usepackage[norule,symbol,perpage]{footmisc} \pagestyle{fancy} \setlength{\parindent}{0pt} \fancyhead{} % clear all header fields \fancyfoot{} % clear all footer fields \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0.4pt} \begin{document} ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage ~ \newpage \end{document} +-----+ https://tex.stackexchange.com/questions/87768/headers-and-footers You can use fancyhdr to facilitate making headers and footers. If you want the first page to have no header or footer---without using any special packages---you can issue \thispagestyle{empty} on the first page. \documentclass{article} \usepackage{lipsum}%% a garbage package you don't need except to create examples. \usepackage{fancyhdr} \pagestyle{fancy} \lhead{This is my name} \rhead{this is page \thepage} \cfoot{center of the footer!} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \begin{document} \thispagestyle{empty} \lipsum[1-20] \end{document} edited Dec 20 '12 at 17:30 answered Dec 20 '12 at 17:24 A.Ellett +-----+ https://www.pcworld.com/article/2043456/review-open-source-freebie-jpdf-tweak-gives-you-power-over-your-pdfs.html jPdf Tweak - Swiss Army Knife for PDF files Open-source developer Michael Schierl describes jPDF Tweak as the "Swiss Army Knife for PDF Files," and it certainly lives up to that promise. Like a real Swiss Army Knife, jPDF provides a variety of functions for your PDF files. This includes making printable booklets, combining PDF files, adding watermarks, rotating pages, encrypting files, changing the metadata, and more. I love this program so much that it has a permanent place on my PC. This Java-based portable app makes a nice addition to the road warrior's USB drive or Dropbox folder. Simply double-click the BAT file to run it. Then load the PDF file from your PC in the "input tab" and choose the next tab you need. When you've made whatever changes you need, go to the "output" tab to generate your tweaked PDF. >> Windows only? http://jpdftweak.sourceforge.net/ jPdf Tweak - Swiss Army Knife for PDF files >> has Linux 64 version! see LMDE2 Software Mgr >> not listed! +-----+ https://askubuntu.com/questions/712691/batch-add-header-footer-to-pdf-files Is there a command or script that would help me ease the process of adding page numbers to a pdf with hundreds of pages? Thanks. pdf batch asked Dec 23 '15 at 11:49 betty Using LaTeX! 0) Install LaTeX if necessary 1) In the following latex document replace x.pdf by your file.pdf \documentclass{article} \RequirePackage[a4paper,top=3cm,left=3cm,right=3cm,bottom=3cm]{geometry} \usepackage{pdfpages} \usepackage{fancyhdr} \begin{document} \fancyfoot[RO]{Braga} \fancyfoot[LO]{2015} \fancyfoot[CO]{===} \fancyhead[LO]{Lecture notes of askubuntu} \fancyhead[RO]{\thepage} \includepdf[pagecommand={\thispagestyle{empty}},pages=1 ]{x.pdf} \includepdf[pagecommand={\thispagestyle{fancy}},pages=2-]{x.pdf} \end{document} 3) run pdflatex addfooter.tex and a addfooter.pdf will be created. 4) adapt the headers, footer (left,center, right), tune margin's sizes, etc. Update: Although LaTeX version give us more control over the details, as @steeldriver, pointed out, in some situations a pdfjam command line is the best choice. Typical use: pdfjam --outfile newfile.pdf --pagecommand '{}' oldfile.pdf shareimprove this answer edited Dec 24 '15 at 11:51 answered Dec 23 '15 at 12:35 JJoao *************** 04Apr2019 [pdflatex, pdftk] - clean up screen junk from [pdflatex, pdftk] with : >>"$p_pdftk_logs" 2>&1 >> OK, now is clean screen! *************** 03Apr2019 I can't find file `tcrm0800' I seem to be missing a font package? This causes the script to halt for input +-----+ pdflatex -output-directory "/media/bill/ramdisk/" -output-format pdf "/media/bill/ramdisk/template.tex" "/media/bill/ramdisk/template.pdf" Halts execution iwth errors, one example below : kpathsea: Running mktextfm tcrm0800 /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation for tcrm0800. /usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update ? mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input tcrm0800 This is METAFONT, Version 2.7182818 (TeX Live 2015/dev/Debian) (preloaded base=mf) kpathsea: Running mktexmf tcrm0800 ! I can't find file `tcrm0800'. <*> ...ljfour; mag:=1; nonstopmode; input tcrm0800 Please type another input file name ! Emergency stop. <*> ...ljfour; mag:=1; nonstopmode; input tcrm0800 *************** 03Apr2019 search "LateX footnote and how do I avoid the \footnoterule" https://latex.org/forum/viewtopic.php?t=22375 Suppress Footnote Rule and Number - LaTeX.org by Stefan Kottwitz » Tue Jan 15, 2013 4:23 pm Just have a look at the documentation, which I linked above. You could use the symbol and perpage options: \usepackage[norule,symbol,perpage]{footmisc} *************** 03Apr2019 search "TexStudio and how do I download packages" $ pdflatex "/media/bill/ramdisk/temtex.tex" +----+ https://tex.stackexchange.com/questions/181024/how-to-add-new-packages-to-texstudio#181043 The Editor has actually nothing to do with the LaTeX System. The packages are installed and updated typically with a package manager from the LaTeX distribution - not with the Editor. If you are using miktex then start the "package manager" and with Tex Live "TeX Live Manager" and add the missing package(s). If you want to avoid problems with missing packages it is a good practice to install all available packages. That way you hardly ever miss a package again. If a package is not available in the repository you could as well copy the .sty file to the place where your .tex file is located. However this should always be the exception. answered May 29 '14 at 11:33 Matthias Pospiech *************** 03Apr2019 Yoonsuck Choe's [clear, copyright] perl script - tex stuff textcomp - not LMDE2 installation installed? >> I removed "\usepackage{textcomp}" >> I put it back! - it is available on my system search for my tex files : $ find "/media/bill/PROJECTS/" -type f -name "*.tex" /media/bill/PROJECTS/My Reviews/z_Old/1_Paper_Review_form_TEXmake.tex /media/bill/PROJECTS/My Reviews/z_Old/1_Paper_Review_form_TEXstudio.tex /media/bill/PROJECTS/System_maintenance/tex/setspace/setspace-test.tex /media/bill/PROJECTS/System_maintenance/tex/170707 Yoonsuck Choe ijcnn Tex scripts/program2.tex /media/bill/PROJECTS/System_maintenance/tex/170707 Yoonsuck Choe ijcnn Tex scripts/program-tex.tex /media/bill/PROJECTS/System_maintenance/tex/170707 Yoonsuck Choe ijcnn Tex scripts/program.tex /media/bill/PROJECTS/2019 IJCNN Budapest/Sponsorships/z_Old/Sponsors prospectus TexStudio 180809.tex /media/bill/PROJECTS/2019 IJCNN Budapest/Sponsorships/z_Old/Sponsors prospectus TexMaker.tex /media/bill/PROJECTS/2019 IJCNN Budapest/Sponsorships/z_Old/web-page/Sponsors prospectus TexStudio.tex /media/bill/PROJECTS/2019 IJCNN Budapest/Sponsorships/z_Old/Sponsors prospectus.tex /media/bill/PROJECTS/2019 IJCNN Budapest/Publications/Conference-LaTeX-template_7-9-18/conference_041818.tex /media/bill/PROJECTS/2019 IJCNN Budapest/Publications/Yoonsuck Choe add-copyright scripts/tmptex.tex /media/bill/PROJECTS/miniProjects/Randell Mills/z_Old/Holverstott 2016 Hydrino energy 181227.tex /media/bill/PROJECTS/miniProjects/Randell Mills/Holverstott 2016 Hydrino energy.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/Quantum Mechanics is a fool's paradise.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/Comparison of basic physics concepts.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/Comparison of Physics concepts.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/General Relativity summary.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/General Relativity is a Turkey.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/Quantum Mechanics summary.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/Speed of light in a vacuum has decreased 1.5 pct over 300 years.tex /media/bill/PROJECTS/miniProjects/Lies, Damned Lies/Speed of light summary.tex