Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PDF sticky notes via LaTeX

949 views
Skip to first unread message

Fawzi Sdudah

unread,
May 27, 2008, 5:05:32 AM5/27/08
to
All,

How would you add PDF sticky notes/comments in a LaTeX file?

Thanks

Lars Madsen

unread,
May 27, 2008, 6:16:54 AM5/27/08
to

basically you cannot

adobe reader can add comments to a file provided that the PDF-file is unlocked
first.

The only program that can unlock a PDF-file is Adobe Acrobat which is a
commercial program.

I have no idea why Adobe has never released any tools to unlock this feature freely.

--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html

Robin Fairbairns

unread,
May 27, 2008, 6:21:32 AM5/27/08
to
Fawzi Sdudah <fawzi....@gmail.com> writes:
>How would you add PDF sticky notes/comments in a LaTeX file?

does cooltooltips (available from any good ctan host or mirror) do
what you're after. the "visual latex faq" uses the package --
http://www.tex.ac.uk/tex-archive/info/visualFAQ/visualFAQ.pdf

a copy of the distribution is at
http://www.tex.ac.uk/tex-archive/macros/latex/contrib/cooltooltips/
--
Robin Fairbairns, Cambridge

Ulrike Fischer

unread,
May 27, 2008, 6:57:40 AM5/27/08
to
Am Tue, 27 May 2008 12:16:54 +0200 schrieb Lars Madsen:


>> How would you add PDF sticky notes/comments in a LaTeX file?

> basically you cannot
>
> adobe reader can add comments to a file provided that the PDF-file is unlocked
> first.
>
> The only program that can unlock a PDF-file is Adobe Acrobat which is a
> commercial program.
>

I just read about the free pdf viewer PDF XChange Viewer
(www.docu-track.com) which seems to be able to comment all pdfs but I
haven't tried it yet.

--
Ulrike Fischer

Josef Kleber

unread,
May 27, 2008, 7:11:28 AM5/27/08
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fawzi Sdudah schrieb:


| All,
|
| How would you add PDF sticky notes/comments in a LaTeX file?
|

With pdflatex you can use somthing like this (see PDF Reference for more
information):

\documentclass{scrartcl}
\usepackage[german]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{marginnote}
\usepackage{hyperref}

\pdfminorversion=6
\makeatletter
\newcommand{\pdftexta}[2][Comment]{%
\def\pa@notiz{}%
\pdfstringdef\pa@notiz{#2}
~ \pdfannot width 0pt height 0.66\baselineskip depth 0pt
~ {
~ /Subtype /Text
~ /C [0.2 0.6 0.6]
/T (Josef Kleber)
/Subj (Überschrift)
/Name (#1)
~ /Contents (\pa@notiz)
~ /Open false
~ }
~ \hspace{0.6cm}
}
\newcommand{\pdfmara}[2][Comment]{%
\def\pa@notiz{}%
\pdfstringdef\pa@notiz{#2}%
\marginnote{%
~ \pdfannot width 0pt height \baselineskip depth 0pt%
~ {%
~ /Subtype /Text%
~ %/C [0.5 0.8 0.4]%
/C [0.5 0.8 0.4 0.3]%
/T (Josef Kleber)
/Subj (Überschrift)%
/Name (#1)%
~ /Contents (\pa@notiz)%
~ /Open false%
~ }%
~ }%
}%
\makeatother

\begin{document}
\doublespacing
\noindent{}Comment \pdftexta[Comment]{Comment} Check
\pdftexta[Check]{Check} Circle \pdftexta[Circle]{Circle} Cross
\pdftexta[Cross]{Cross} Help \pdftexta[Help]{Help} Insert
\pdftexta[Insert]{Insert} Key \pdftexta[Key]{Key} NewParagraph
\pdftexta[NewParagraph]{NewParagraph} Note \pdftexta[Note]{Note}
Paragraph \pdftexta[Paragraph]{Paragraph} RightArrow
\pdftexta[RightArrow]{RightArrow} RightPointer
\pdftexta[RightPointer]{RightPointer} Star \pdftexta[Star]{Star} UpArrow
\pdftexta[UpArrow]{UpArrow} UpLeftArrow \pdftexta[UpLeftArrow]{UpLeftArrow}

You need comments? \pdfmara{Insert your comment here!}
\end{document}

For the gurus: There seems to be a bug in Adobe Reader or pdflatex (i
think it's the Reader) with color handling. The last annotation is using
CMYK (4 values!), but it's just uesed for the icon. The frame is drawn
in RGB with the 3 first values

Josef

- --
Keine Sicherheit ohne Schäuble:
GNUPG/PGP-Key unter http://www.josef-kleber.de/pgp/Josef_Kleber_News.asc
DSA 1024 / 0xF4B1EA2A / F832 6058 319E FFD4 0EFF 088C 521B 40D4 F4B1 EA2A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg77F8ACgkQUhtA1PSx6iqeLACdFCnPGUewBkGo9vW5lwh2aEKF
UmcAoLnEoO3tDPB39ypUuwpHQf/AaHP5
=3Dcf
-----END PGP SIGNATURE-----

Josef Kleber

unread,
May 27, 2008, 7:20:56 AM5/27/08
to
Here's the example again. Sorry, it got messed up by Enigmail

\documentclass{scrartcl}
\usepackage[german]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{marginnote}
\usepackage{hyperref}

\pdfminorversion=6
\makeatletter
\newcommand{\pdftexta}[2][Comment]{%
\def\pa@notiz{}%
\pdfstringdef\pa@notiz{#2}

\pdfannot width 0pt height 0.66\baselineskip depth 0pt

{
/Subtype /Text


/C [0.2 0.6 0.6]
/T (Josef Kleber)
/Subj (Überschrift)
/Name (#1)

/Contents (\pa@notiz)
/Open false


}
\hspace{0.6cm}
}
\newcommand{\pdfmara}[2][Comment]{%
\def\pa@notiz{}%
\pdfstringdef\pa@notiz{#2}%
\marginnote{%

\pdfannot width 0pt height \baselineskip depth 0pt%

{%
/Subtype /Text%


%/C [0.5 0.8 0.4]%
/C [0.5 0.8 0.4 0.3]%
/T (Josef Kleber)
/Subj (Überschrift)%
/Name (#1)%

/Contents (\pa@notiz)%
/Open false%
}%
}%
}%
\makeatother

\begin{document}
\doublespacing
\noindent{}Comment \pdftexta[Comment]{Comment} Check
\pdftexta[Check]{Check} Circle \pdftexta[Circle]{Circle} Cross
\pdftexta[Cross]{Cross} Help \pdftexta[Help]{Help} Insert
\pdftexta[Insert]{Insert} Key \pdftexta[Key]{Key} NewParagraph
\pdftexta[NewParagraph]{NewParagraph} Note \pdftexta[Note]{Note}
Paragraph \pdftexta[Paragraph]{Paragraph} RightArrow
\pdftexta[RightArrow]{RightArrow} RightPointer
\pdftexta[RightPointer]{RightPointer} Star \pdftexta[Star]{Star} UpArrow
\pdftexta[UpArrow]{UpArrow} UpLeftArrow \pdftexta[UpLeftArrow]{UpLeftArrow}

You need comments? \pdfmara{Insert your comment here!}
\end{document}

Josef

Lars Madsen

unread,
May 27, 2008, 8:04:15 AM5/27/08
to

interesting

but it still does not allow others to add comments to a given PDF-file

Martin Heller

unread,
May 27, 2008, 8:37:43 AM5/27/08
to
Josef Kleber skrev:

> Fawzi Sdudah schrieb:
> | All,
> |
> | How would you add PDF sticky notes/comments in a LaTeX file?
> |
>
> With pdflatex you can use somthing like this (see PDF Reference for more
> information):

See also the package pdfnotiz which provides something very similar

\pdfmarginnote[Comment]{My comment}

> For the gurus: There seems to be a bug in Adobe Reader or pdflatex (i
> think it's the Reader) with color handling. The last annotation is using
> CMYK (4 values!), but it's just uesed for the icon. The frame is drawn
> in RGB with the 3 first values

Documents with notes added in this way does not print correctly
on my system if I do ctrl+T (print with comment sommery) in
Acrobat Reader or Acrobat Professional: The comments do print,
but the text of the document dissapears. I have tried Acrobat
Reader 8.0 and Acrobat Professional 7.0. It seems to be specific
for commented pdf's made with pdfLaTeX since commented
pdf-documents from other programs print as expected.

Bob Tennent

unread,
May 27, 2008, 8:30:33 AM5/27/08
to
On Tue, 27 May 2008 14:04:15 +0200, Lars Madsen wrote:
>
> but it still does not allow others to add comments to a given PDF-file

The program flpsed can be used to add "comments" to any PDF file:

http://www.ecademix.com/JohannesHofmann/flpsed.html

Bob T.

Josef Kleber

unread,
May 27, 2008, 10:09:31 AM5/27/08
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Heller schrieb:


| Josef Kleber skrev:
|> Fawzi Sdudah schrieb:
|> | All,
|> |
|> | How would you add PDF sticky notes/comments in a LaTeX file?
|> |
|>
|> With pdflatex you can use somthing like this (see PDF Reference for more
|> information):
|
| See also the package pdfnotiz which provides something very similar
|
| \pdfmarginnote[Comment]{My comment}

I know. ;-) Take a look at the package author! ;-) It's largely based on
Scott Pakin's cooltooltips.sty with deleting the mouseover effects and
using real clicks plus some additions like \pdfmarginnote. But it's more
or less just an auxiliary style for dvdcoll.cls. It's not really
configurable.
I'm writing another style file at the moment with a more user-friendly
interface to pdftex's \pdfannot for pdf text annotations. That's were i
found this curious bug while testing.

|> For the gurus: There seems to be a bug in Adobe Reader or pdflatex (i
|> think it's the Reader) with color handling. The last annotation is using
|> CMYK (4 values!), but it's just uesed for the icon. The frame is drawn
|> in RGB with the 3 first values
|
| Documents with notes added in this way does not print correctly on my
| system if I do ctrl+T (print with comment sommery) in Acrobat Reader or
| Acrobat Professional: The comments do print, but the text of the
| document dissapears. I have tried Acrobat Reader 8.0 and Acrobat
| Professional 7.0. It seems to be specific for commented pdf's made with
| pdfLaTeX since commented pdf-documents from other programs print as
| expected.

Okay. I will wait what will come up in this thread. It's still a long
day anywhere in the west! ;-)
I will contact the pdftex team then and report the problems.

Josef

- --
Keine Sicherheit ohne Schäuble:
GNUPG/PGP-Key unter http://www.josef-kleber.de/pgp/Josef_Kleber_News.asc
DSA 1024 / 0xF4B1EA2A / F832 6058 319E FFD4 0EFF 088C 521B 40D4 F4B1 EA2A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg8FhsACgkQUhtA1PSx6iqQWQCdHixGrkBSP7WzETgHQgccAzHS
ersAniY7GgVtuMeCtrVrYySmmIP6eY6i
=kr3i
-----END PGP SIGNATURE-----

Josef Kleber

unread,
May 27, 2008, 10:10:34 AM5/27/08
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lars Madsen schrieb:


|
| interesting
|
| but it still does not allow others to add comments to a given PDF-file
|

No, as Adobe wants to earn money with it. But it's possible to do in the
latex source, as the OP wanted.
To comment given pdf-files, the best free solution i'm aware of at the
moment is (as Ulrike already pointed out) the PDF XChange viewer. So
Adobe will no longer be able to make money with it, maybe they change
their policy now. Okay, of course not! ;-)

Josef

- --


Keine Sicherheit ohne Schäuble:
GNUPG/PGP-Key unter http://www.josef-kleber.de/pgp/Josef_Kleber_News.asc
DSA 1024 / 0xF4B1EA2A / F832 6058 319E FFD4 0EFF 088C 521B 40D4 F4B1 EA2A

-----BEGIN PGP SIGNATURE-----


Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg8FloACgkQUhtA1PSx6iovIwCfe5R2XZB8YIXHBpIEagHCF0KB
TegAnRlQVw/y0yQRQ2dMFNcxxpDA3U27
=6Ede
-----END PGP SIGNATURE-----

Fawzi Sdudah

unread,
May 29, 2008, 2:04:27 PM5/29/08
to
On May 27, 10:10 am, Josef Kleber <josef.kle...@nurfuerspam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Lars Madsen schrieb:
> |
> | interesting
> |
> | but it still does not allow others to add comments to a givenPDF-file
> |
>
> No, as Adobe wants to earn money with it. But it's possible to do in the
> latex source, as the OP wanted.
> To comment givenpdf-files, the best free solution i'm aware of at the
> moment is (as Ulrike already pointed out) thePDFXChange viewer. So

> Adobe will no longer be able to make money with it, maybe they change
> their policy now. Okay, of course not! ;-)
>
> Josef
>
> - --
> Keine Sicherheit ohne Schäuble:
> GNUPG/PGP-Key unterhttp://www.josef-kleber.de/pgp/Josef_Kleber_News.asc

> DSA 1024 / 0xF4B1EA2A / F832 6058 319E FFD4 0EFF 088C 521B 40D4 F4B1 EA2A
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (MingW32)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

>
> iEYEARECAAYFAkg8FloACgkQUhtA1PSx6iovIwCfe5R2XZB8YIXHBpIEagHCF0KB
> TegAnRlQVw/y0yQRQ2dMFNcxxpDA3U27
> =6Ede
> -----END PGP SIGNATURE-----

Thanks all,

I thought I would receive auto notifications to this thread after
subscribing to it, but that has not happened so far-may check my subs.
settings.
Anyways, I have searched this group to find out that you can use:

\pdfannot
{
/Subtype /Text
/Contents
(Test annotation)
}

which is also presented by Josef here. The above works but there is no
control on where to place it on the page. I think Josef's code solves
that problem but I have to give it shot.

Fawzi

Martin Heller

unread,
May 29, 2008, 3:35:40 PM5/29/08
to
Josef Kleber skrev:

> Okay. I will wait what will come up in this thread. It's still a long
> day anywhere in the west! ;-)
> I will contact the pdftex team then and report the problems.

I sent this to the pdfTeX mailing list a couple of days ago.
Maybe you can make sense of it?

Notes in pdf documents created with pdfLaTeX does not print
correcty from Acrobat Reader 8.0 and Acrobat Professional 7.0.

This document

\documentclass{scrartcl}
\usepackage{hyperref}
\usepackage{pdfnotiz}
\usepackage{lipsum}
\begin{document}
\pdfmarginnote[Note]{This is a note.}
\lipsum
\end{document}

when printed with comments summary (Ctrl+T in Acrobat
Reader/Professional) will not print the text (Lorem ipsum...).

This prints correctly (documentclass changed):

\documentclass{article}
\usepackage{hyperref}
\usepackage{pdfnotiz}
\usepackage{lipsum}
\begin{document}
\pdfmarginnote[Note]{This is a note.}
\lipsum
\end{document}

If I add a note with Acrobat Professional in this document

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}

The text does not print. I can compile the same document with
latex -> dvips -> ps2pdf and add a note with Acrobat Professionel
and it prints correctly.

If I add a note with Acrobat Professional in this document
(hyperref added)

\documentclass{article}
\usepackage{hyperref}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}

and compile with pdflatex it prints correctly.

I am using MikTeX 2.6 with the latest updates installed with the
package manager.

This is pdfTeX, Version 3.141592-1.40.4 (MiKTeX 2.6) (preloaded
format=pdflatex 2008.2.28) 28 MAY 2008 11:07
entering extended mode

Josef Kleber

unread,
May 30, 2008, 5:49:28 AM5/30/08
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Heller schrieb:


| Josef Kleber skrev:
|
|> Okay. I will wait what will come up in this thread. It's still a long
|> day anywhere in the west! ;-)
|> I will contact the pdftex team then and report the problems.
|
| I sent this to the pdfTeX mailing list a couple of days ago.

Ah, okay.

| Maybe you
| can make sense of it?

That's a bit optimistic, I'm afraid! ;-)

| Notes in pdf documents created with pdfLaTeX does not print
| correcty from Acrobat Reader 8.0 and Acrobat Professional 7.0.
|
| This document
|
| \documentclass{scrartcl}
| \usepackage{hyperref}
| \usepackage{pdfnotiz}
| \usepackage{lipsum}
| \begin{document}
| \pdfmarginnote[Note]{This is a note.}
| \lipsum
| \end{document}
|
| when printed with comments summary (Ctrl+T in Acrobat
| Reader/Professional) will not print the text (Lorem ipsum...).
|
| This prints correctly (documentclass changed):
|
| \documentclass{article}
| \usepackage{hyperref}
| \usepackage{pdfnotiz}
| \usepackage{lipsum}
| \begin{document}
| \pdfmarginnote[Note]{This is a note.}
| \lipsum
| \end{document}
|

I absolutly don't understand why the documentclass should change the
behavior. \pdfannot includes a annotation in pdf code directly, as i
understand. Maybe you can contact Markus Kohm, but a don't think it's a
problem of komascript.
But i can't test it anyway, because there's no CTRL+T in my Adobe Reader
(Win;AR8.1). Just the standard CTRL+P and i don't have a full Acrobat.

Josef

- --
Keine Sicherheit ohne Schäuble:
GNUPG/PGP-Key unter http://www.josef-kleber.de/pgp/Josef_Kleber_News.asc
DSA 1024 / 0xF4B1EA2A / F832 6058 319E FFD4 0EFF 088C 521B 40D4 F4B1 EA2A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg/zacACgkQUhtA1PSx6ir+KACfeIm3lN3fGJ/IhmQGxgavsy8A
UOUAnRGJSzhR1CzMxaVW27lG5rEwvyJ4
=yPlz
-----END PGP SIGNATURE-----

darren

unread,
Jun 12, 2008, 3:43:03 AM6/12/08
to
Lars Madsen wrote:
> The only program that can unlock a PDF file is Adobe Acrobat which is a
> commercial program.

This is not true. ghostscript can remove passwords from PDF's.

If you are at all serious about PDF security, then use a Digital
Certificate. Ghostscript can't touch PDF's locked with those. Acrobat
8 Professional supports self-signed certificates.

1. Install Ghostscript
http://www.ghostscript.com/awki
http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/


2. Install the current version of gs and create a .cmd batch file in C:
\Program Files\gs\gs8.62\bin

8.62-unlockpdf.cmd
-------------------
@echo off
echo This may take a minute, please wait.
echo.
set ttt=%1
set tt=%ttt:~0,-5%
gswin32c -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sFONTPATH=
%windir%/fonts;xfonts;. -sPDFPassword= -dPDFSETTINGS=/prepress -
dPassThroughJPEGImages=true -sOutputFile=%tt%_noPW.pdf" %1

pause
echo pause added so you can see any error messages...
'Written by SMTguru
------------------------

3. Put an icon shortcut to this .cmd on the desktop

4. drag and drop the locked pdf onto the icon.

5. marvel as ghostscript removes the password from the PDF, for free,
within seconds by creating an unlocked _noPW.pdf file in the same
location as the original locked PDF.

If there are Chinese or Japanse fonts in the PDF, then read this :
http://groups.google.com/group/comp.lang.postscript/browse_frm/thread/a547be1a73f4ba3f/2dccbce925e04c6c?lnk=st&q=pdf+unlock#2dccbce925e04c6c

Martin Heller

unread,
Jun 12, 2008, 4:31:14 AM6/12/08
to
darren skrev:

> Lars Madsen wrote:
>> The only program that can unlock a PDF file is Adobe Acrobat which is a
>> commercial program.
>
> This is not true. ghostscript can remove passwords from PDF's.

But can ghostscript enable commenting in Adobe Reader?

Lars Madsen

unread,
Jun 12, 2008, 4:46:27 AM6/12/08
to
darren wrote:
> Lars Madsen wrote:
>> The only program that can unlock a PDF file is Adobe Acrobat which is a
>> commercial program.
>
> This is not true. ghostscript can remove passwords from PDF's.

it is not a password, it is a feature that has to be enabled in the PDF-file. I
would assume that it is some sort of applied digital signature. Without this you
cannot add notes using adobe Reader. And the only program that can add this
feature is Adobe Acrobat Pro.

If you can activate this feature (easy to test in Adobe Reader) using
ghostscript, I'd like to see it.

0 new messages