Re: [NTG-context] Unwanted information in PDF files

2007-12-12 Thread Wolfgang Schuster
2007/12/12, Maurí­cio [EMAIL PROTECTED]:
 Hi,

 After generating a PDF from a .tex file,
 I changed the name of the resulting PDF to
 something else. But when I open that file in
 'evince', it still shows the old file name.

 I opened that file in emacs in saw that I lot
 of info is stored in the PDF file: original file
 name, creation date, generated by Context etc.

 That can be a problem sometimes. For instance,
 someone wouldn't want to write a file like
 'I_hate_my_job.tex' and then change the result
 to 'report_to_boss.pdf', just to see his manager
 opening the file and reading the first name. Or,
 in my situation, write a file with special
 Unicode characters and see evince show the file
 name as bogus characters.

 How can I instruct Context not to write anything
 inside the PDF file that I have not asked for?

 Thanks,
 Maurício

\setupinteraction[title=...]

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Unwanted information in PDF files

2007-12-12 Thread Peter Rolf
Maurí­cio schrieb:
 Hi,
 
 After generating a PDF from a .tex file,
 I changed the name of the resulting PDF to
 something else. But when I open that file in
 'evince', it still shows the old file name.
 
 I opened that file in emacs in saw that I lot
 of info is stored in the PDF file: original file
 name, creation date, generated by Context etc.

Hit Ctrl-D in Acrobat (while viewing the document),
tabs Description and Custom...

 That can be a problem sometimes. For instance,
 someone wouldn't want to write a file like
 'I_hate_my_job.tex' and then change the result
 to 'report_to_boss.pdf', just to see his manager
 opening the file and reading the first name. Or,
 in my situation, write a file with special
 Unicode characters and see evince show the file
 name as bogus characters.

Not the best example, but in general I agree. In my special case I don't
want the overhead for smaler standalone metapost graphics (for inclusion
only).

 How can I instruct Context not to write anything
 inside the PDF file that I have not asked for?

There is currently no interface for this. But you are free (with the
risk of breaking things now or in the future) to change the code for
your needs.


Add this to a standalone file (reporttoboss.tex?) for inclusion and
comment the info you don't want:

\unprotect
% code taken from spec-fdf.tex

\def\doPDFsetupidentity#1#2#3#4#5#6%
  {\bgroup
   \enablePDFdocencoding
   \edef\!!stringa{#5}%
   \ifx\!!stringa\empty \ifx\pdfdate\undefined\else
 \edef\!!stringa{D:\pdfdate}%
   \fi \fi
   \expanded{\doPDFaddtoinfo
 {/Title (#1)
  /Subject (#2)
  /Author (#3)
  /Creator (#4)
  /ModDate (\!!stringa)
%%  /ID (\jobname.\!!stringa) % needed for pdf/x
  /Keywords (#6)}}%
   \egroup}


\def\addPDFdocumentinfo
  {\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}%
   \doPDFaddtocatalog{/Version \ifdim\PDFversion00\points100\points
1.\fi\PDFversion}%
   \doPDFaddtoinfo{/Trapped /False}% !leave unchanged!
   \doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}%
   \doPDFaddtoinfo{/ConTeXt.Time
(\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space
\twodigits\currenthour:\twodigits\currentminute)}%
%%   \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}%
   \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}}

\protect
\endinput

See the pdf reference manual for more details. And better check from
time to time if things have changed. This is ConTeXt ;)


Regards, Peter


 Thanks,
 Maurício
 
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___
 



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Unwanted information in PDF files

2007-12-12 Thread Martin Schröder
2007/12/12, Peter Rolf [EMAIL PROTECTED]:
\doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}%
\doPDFaddtoinfo{/ConTeXt.Time
 (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space
 \twodigits\currenthour:\twodigits\currentminute)}%
 %%   \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}%
\doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}}

While this is a nice idea, prefixes for additional keys in the info
dict should be registered with Adobe to avoid name clashes; see
appendix E of the PDF reference.

Best
   Martin
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___