Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-13 Thread Ross Moore

On Jul 11, 2016, at 7:59 PM, Zdenek Wagner 
mailto:zdenek.wag...@gmail.com>> wrote:

Especially this one, it depends on a lot of files. I wanted to extract ideas 
how to build the XMP, how to include the ICC but I gave up.

XMP is done via a template file; e.g.  pdfx.xmp  or  pdfa.xmp .
There are many places where information can be supplied, via macros
such as  \xmp@Subject  and  \xmp@Author .
Much of the  pdfx  package is about supplying values for these, in UTF8 
encoding.


I know, writing XMP is easy, I do not know how to include it. I do not like to 
use hyperref for a document that will only be pronted and never will be online.

Using pdfTeX it is done like this in  pdfx.sty :

   \def\pdfx@numcoords{/N 4}% for CMYK colors
   \immediate\pdfobj stream attr{\pdfx@numcoords} file %
 {\pdfx@CMYKcolorprofiledir\pdfx@cmyk@profile}%
   \edef\OBJ@CMYK{\the\pdflastobj\space 0 R}%

Then that object reference in \OBJ@CMYK  is required for the  OutputIntent .
viz.

  \def\pdfx@outintent@dict{%
/Type/OutputIntent
/S/GTS_PDFX^^J
/OutputCondition (\pdfx@cmyk@intent)^^J
/OutputConditionIdentifier (\pdfx@cmyk@identifier)^^J
/Info(\pdfx@cmyk@intent)^^J
/RegistryName(\pdfx@cmyk@registry)
/DestOutputProfile \OBJ@CMYK
   }%

which is linked to the PDF Catalog via:

 \immediate\pdfobj{<<\pdfx@outintent@dict>>}%
  \edef\pdfx@outintents{[\the\pdflastobj\space 0 R]}%
 \def\pdfx@outcatalog@dict{%
  /ViewerPreferences <>
  /OutputIntents \pdfx@outintents % needs appropriate expansion
 }%
 \pdfcatalog{\pdfx@outcatalog@dict}%


Of course you need to supply all the information for the macros:
  \pdfx@cmyk@….
and  \pdfx@CMYKcolorprofiledir  (possibly empty).


Using XeTeX there is similar coding using  \special s,
including symbolic names for object references.
e.g.

\def\OBJ@CMYK{@colorprofile}%
\special{pdf:fstream @colorprofile %
  (\pdfx@CMYKcolorprofiledir\pdfx@cmyk@profile) <<\pdfx@numcoords >>}
   \def\pdfx@outintents{ @outintentsarray }%
   \def\pdfx@outintentref{ @outintent@dict }%
   \immediate\special{pdf:obj \pdfx@outintentref << \pdfx@outintent@dict >>}
   \immediate\special{pdf:obj \pdfx@outintents [ ]}%
   \immediate\special{pdf:put \pdfx@outintents \pdfx@outintent@dict}%

with \pdfcatalog defined appropriately:

 \def\pdfx@catalog@xetex#1{\special{pdf:put @catalog <<#1>>}}


You should be able to put all the pieces together now.

Cheers,

Ross


Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz


Dr Ross Moore

Mathematics Dept | Level 2, S2.638 AHH
Macquarie University, NSW 2109, Australia

T: +61 2 9850 8955  |  F: +61 2 9850 8114
M:+61 407 288 255  |  E: 
ross.mo...@mq.edu.au

http://www.maths.mq.edu.au


[cid:image001.png@01D030BE.D37A46F0]


CRICOS Provider Number 2J. Think before you print.
Please consider the environment before printing this email.

This message is intended for the addressee named and may
contain confidential information. If you are not the intended
recipient, please delete it and notify the sender. Views expressed
in this message are those of the individual sender, and are not
necessarily the views of Macquarie University.



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-13 Thread Philip Taylor
Hallo Zdeněk --
> It is strange, you should complain for poor connection. My ADSL speed
> is nominally 8 Mbps. Since the line is overloaded, the real speed is
> usually 6 Mbps. Installation of scheme full from the neares mirror
> takes about one hour. You wrote your speed is 2.7 Mbps, so it should
> complete withint two or three hours. The problem may be cause by loss
> of too many packets due to some noise. So you probably pay for very
> low quality and the provider should fix it. Many companies provide
> free service for measurement the real speed, you just connect to a web
> page of such a company and it measures the speed of download and
> upload and stability. If it is too different from what you pay, you
> should complain.
In fact, run against (e.g., the HTML 5 speed tester), I get quite good download 
speed normally, but TeX Live installation always takes forever.  I know from 
past experience that Rsynch is much faster, but that no longer works for TeX 
Live 2016 (reported a couple of days ago), so I have little option but to sit 
it out ...

Repost of Rsynch problem, in case anyone can shed light on it :

> E:\TeX\Live\2016\TLnet>rsync -a --delete 
> rsync://ftp.heanet.ie/mirrors/ctan.org/tex/systems/texlive/tlnet/ .
>
> (also rsync -a --delete 
> rsync://mirror.physik-pool.tu-berlin.de/ctan/systems/texlive/tlnet/ .)
>
> rsync: symlink "/e/TeX/Live/2016/TLnet/update-tlmgr-latest.exe" -> 
> "update-tlmgr-r41476.exe" failed: Bad file number (9)
> rsync: symlink "/e/TeX/Live/2016/TLnet/update-tlmgr-latest.exe.sha512" -> 
> "update-tlmgr-r41476.exe.sha512" failed: Bad file number (
> 9)
> rsync: symlink "/e/TeX/Live/2016/TLnet/update-tlmgr-latest.exe.sha512.asc" -> 
> "update-tlmgr-r41476.exe.sha512.asc" failed: Bad file
> number (9)
> rsync: symlink "/e/TeX/Live/2016/TLnet/update-tlmgr-latest.sh" -> 
> "update-tlmgr-r41476.sh" failed: Bad file number (9)
> rsync: symlink "/e/TeX/Live/2016/TLnet/update-tlmgr-latest.sh.sha512" -> 
> "update-tlmgr-r41476.sh.sha512" failed: Bad file number (9)
>
> rsync: symlink "/e/TeX/Live/2016/TLnet/update-tlmgr-latest.sh.sha512.asc" -> 
> "update-tlmgr-r41476.sh.sha512.asc" failed: Bad file nu
> mber (9)
> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at 
> /usr/src/rsync/rsync-3.0.8/rsync.c(549) [generator=3.0.8]
>
> E:\TeX\Live\2016\TLnet>rsync error: received SIGUSR1 (code 19) at 
> /usr/src/rsync/rsync-3.0.8/main.c(1298) [receiver=3.0.8]
>
** Phil.
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-13 Thread Zdenek Wagner
It is strange, you should complain for poor connection. My ADSL speed
is nominally 8 Mbps. Since the line is overloaded, the real speed is
usually 6 Mbps. Installation of scheme full from the neares mirror
takes about one hour. You wrote your speed is 2.7 Mbps, so it should
complete withint two or three hours. The problem may be cause by loss
of too many packets due to some noise. So you probably pay for very
low quality and the provider should fix it. Many companies provide
free service for measurement the real speed, you just connect to a web
page of such a company and it measures the speed of download and
upload and stability. If it is too different from what you pay, you
should complain.

Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz


2016-07-13 9:49 GMT+02:00 Philip Taylor :
>
>
> Philip Taylor wrote:
>> Understood, Zdeněk -- that will be tonight's overnight run.
> Sadly I exaggerated; 10 hours later, still at 1983/2981 :-(
>
>
> --
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-13 Thread Philip Taylor


Philip Taylor wrote:
> Understood, Zdeněk -- that will be tonight's overnight run.  
Sadly I exaggerated; 10 hours later, still at 1983/2981 :-(


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-12 Thread Philip Taylor


Zdenek Wagner wrote:
> Hi Philip,
>
> the problem is that TeX Live maintains dependencies by collections,
> not by individual packages. Thus if you install a package, it does not
> mean that you have all what is needed. Especially pdfx is very complex
> and requires a lot of other files. Installation of shceme-full may be
> faster than fishing all required packages one by one.
> Zdeněk Wagner
Understood, Zdeněk -- that will be tonight's overnight run.  But will it fix 
the 1" vertical displacement of my projects between TeX Live 2014 and TeX Live 
2016 ?!

** Phil.


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-12 Thread Zdenek Wagner
Hi Philip,

the problem is that TeX Live maintains dependencies by collections,
not by individual packages. Thus if you install a package, it does not
mean that you have all what is needed. Especially pdfx is very complex
and requires a lot of other files. Installation of shceme-full may be
faster than fishing all required packages one by one.
Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz


2016-07-12 19:40 GMT+02:00 Martin Schröder :
> 2016-07-12 19:24 GMT+02:00 Philip Taylor :
>> If I had the time, I would (see my earlier message about incremental TeX 
>> live installations);
>
> You invest your time unwisely. You save some time by not installing
> everything and
> waste more of your (and our!) time by fixing problems from this
> incomplete installation.
> Get the DVD and install from there, if your internet is so broken.
>
>> I thought (probably wrongly) that TeX Live "knew" about dependencies, and 
>> installed the necessary support files when a package was installed ..
>
> AFAIK it could use these dependences but these are not maintained. I
> see a project you could contribute to.
>
> Best
>Martin
>
>
> --
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-12 Thread Martin Schröder
2016-07-12 19:24 GMT+02:00 Philip Taylor :
> If I had the time, I would (see my earlier message about incremental TeX live 
> installations);

You invest your time unwisely. You save some time by not installing
everything and
waste more of your (and our!) time by fixing problems from this
incomplete installation.
Get the DVD and install from there, if your internet is so broken.

> I thought (probably wrongly) that TeX Live "knew" about dependencies, and 
> installed the necessary support files when a package was installed ..

AFAIK it could use these dependences but these are not maintained. I
see a project you could contribute to.

Best
   Martin


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-12 Thread Philip Taylor
If I had the time, I would (see my earlier message about incremental TeX live 
installations); but I don't, I have time only to install the essentials for 
what I need.  And I am confused as to how a package such as "pdfx" can be 
incomplete --  I thought (probably wrongly) that TeX Live "knew" about 
dependencies, and installed the necessary support files when a package was 
installed ..

** Phil.

Richard Koch wrote:
> The “small” scheme is just BasicTeX, which I created. So this comes from
> the horses mouth. INSTALL THE FULL TEXLIVE.
>
> Dick Koch

-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-12 Thread Richard Koch
Philip,

Everyone I know in TUG recommends installation of the full TeX Live,
to avoid precisely the sort of problem you are now having. I had
trouble getting TUG to support BasicTeX on the Mac for this reason.

The “small” scheme is just BasicTeX, which I created. So this comes from
the horses mouth. INSTALL THE FULL TEXLIVE.

Dick Koch


> On Jul 12, 2016, at 10:09 AM, Philip Taylor  wrote:
> 
> 
> 
> Ross Moore wrote:
>> The package, once installed, comes with two example documents:
>> 
>>sample.tex
>>small2e-pdfx.tex
>> 
>> If you have the most recent TeXLive 2016 installed, 
>> you can find them this way:
> OK, I now have TeX Live 2016 installed ((small scheme plus a few options) and 
> have added the pdfx package using the TeX Live manager; however, compilation 
> of "small2e-pdfx" fails as follows :
> 
>> 
>> pdfx.sty  
>> 1778
>> LaTeX Error: File `xmpincl.sty' not found.
>> 
>> Type X to quit or  to proceed,
>> or enter new name. (Default extension: sty)
>> 
>> (e:/TeX/Live/2016/texmf-dist/tex/latex/pdfx/8bit.def)
>> Using XMP template file: pdfa.xmp
>> ! Undefined control sequence.
>> l.1778  \includexmp
>>{\xmp@template}%
> and asking TeX Live manager to locate "xmpincl" returns no hits ...
> 
> ** Phil.
> -- 
> 
> Philip Taylor
> 
> 
> --
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex 



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-12 Thread Philip Taylor


Ross Moore wrote:
> The package, once installed, comes with two example documents:
>
>sample.tex
>small2e-pdfx.tex
>
> If you have the most recent TeXLive 2016 installed, 
> you can find them this way:
OK, I now have TeX Live 2016 installed ((small scheme plus a few options) and 
have added the pdfx package using the TeX Live manager; however, compilation of 
"small2e-pdfx" fails as follows :

> pdfx.sty 
>
>   
>
> 1778
>
>   
>
> LaTeX Error: File `xmpincl.sty' not found. Type X to quit or  to 
> proceed, or enter new name. (Default extension: sty) 
> (e:/TeX/Live/2016/texmf-dist/tex/latex/pdfx/8bit.def) Using XMP template 
> file: pdfa.xmp ! Undefined control sequence. l.1778  \includexmp  
>   {\xmp@template}%
>
and asking TeX Live manager to locate "xmpincl" returns no hits ...

** Phil.
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Philip Taylor


Ross Moore wrote:
> Hi Phil,
>
>> On Jul 12, 2016, at 7:55 AM, Philip Taylor > > wrote:
>
>>> one can zoom in to examine specific parts. The text is fully mapped
>>> to Unicode, for easy searching and Copy/Paste.
>> What did surprise me is that hyperlinks are not active in the online 
>> version; one has to copy them and paste them into a browser, which is 
>> somewhat counter-intuitive.
>
> Jumping to conclusions again?  :-)
No, tried and no result whatsoever.  I use Adobe Acrobat Pro V7.1, and I 
regularly use it to follow hyperlinks in PDF (e.g., those from the image 
captions in 
"http://rhul.ac.uk/Hellenic-Institute/Research/LPL/Greek-MSS/Catalogue.pdf";) 
but for "http://mirrors.ctan.org/macros/latex/contrib/pdfx/pdfx.pdf"; I saw no 
effect whatsoever -- the text was of a different colour, but completely 
inactive.  However, I now see that I had previously been using Acrobat to edit 
an advertisement, and the currently selected tool was the text touch-up tool 
rather than the select tool, which does indeed explain the apparent 
dysfunctionality of the hyperlinks.  I am happy to confirm that (a 
representative sample of) the hyperlinks in 
"http://mirrors.ctan.org/macros/latex/contrib/pdfx/pdfx.pdf"; do indeed work as 
expected.I have only TeX Live 2014 (I always lag one or two releases) but 
"TeXdoc pdfx" displays the expected document so I may well have them; I will 
check tomorrow.
> Sounds good.
>
> Check that it is for v.1.5.8 with 81 pages incl. source listing in pdfx.pdf .
> The version number is at bottom right, in the footer.
>
> The one for  v.1.5.6 looks similar at the front, but the docs are much 
> shorter.
> (Only 12 pages w/o source listing.)
> Earlier versions have a different color scheme.
Mine is even earlier (only 9 pp); I shall have to install a more recent version.
> BTW, if you are going to work with PDFs into the future,
> invest in the latest Acrobat Pro DC. 
> I don’t know how much it costs for non-academic in the UK,
> but it’ll be the best 100–200 pounds you have ever spent,
> in terms of the time that it will save you.
I still have full academic status (Honorary Research Assistant) so could get it 
at an academic price, but as I wrote previously I unfortunately have no budget 
for such things -- all work that I have done since taking early retirement 
eight years ago has been strictly /pro bono/.  I also find ('though I may be 
wrong in the case of Adobe Acrobat) that modern versions of packages with which 
I am familiar in an older guise tend to have very non-ergonomic and cryptic 
user interfaces as (e.g.,) text labels are phased out in favour of cryptic 
icons and/or tiles.  Looking at Adobe Reader DC, for example, it looks as if it 
is intended for use only on a tablet or similar -- the "Tools" menu uses huge 
tiles and falls off the bottom of my (reasonably large) screen.  Support for 
modern devices may be commendable, but not when it is at the expense of support 
for the traditional keyboard and monitor setup.
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Philip Taylor


Ross Moore wrote:
> That document makes no claim to be conformant to any PDF/X standard.
> Instead it is fully conformant with  PDF/A-2u — see image.
OK, then I was confused by its name.
> We supply PDF/A — for an archival version, with RGB monitor intent,
> as this corresponds most appropriately to the purpose of the document.
> It is a manual that will mostly be viewed and read online/onscreen.
> It contains several screen-shots which are best read online where
> one can zoom in to examine specific parts. The text is fully mapped
> to Unicode, for easy searching and Copy/Paste.
What did surprise me is that hyperlinks are not active in the online version; 
one has to copy them and paste them into a browser, which is somewhat 
counter-intuitive.
> I think that you have assumed that it will do what *you* want it
> to do, without having read the supplied documentation.
> That is always a recipe for disappointment.
Sorry, your assumption concerning my assumption is quite correct, but my 
assumption was based on your earlier message.

> The package, once installed, comes with two example documents:
>
>sample.tex
>small2e-pdfx.tex
>
> If you have the most recent TeXLive 2016 installed, 
> you can find them this way:
I have only TeX Live 2014 (I always lag one or two releases) but "TeXdoc pdfx" 
displays the expected document so I may well have them; I will check tomorrow.

Many thanks for your help, Ross; I shall continue tomorrow.
** Phil.
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Philip Taylor
Dear Ross (copy all) -- OK, I looked at the "pdfx" package and the first thing 
that surprised me was that the documentation file for it 
(http://mirrors.ctan.org/macros/latex/contrib/pdfx/pdfx.pdf), when inspected 
using Adobe Acrobat 7.1, fails the conformity check for PDF/X-1A:2003 on nine 
counts --

 1. Annotation inside page area
 2. Document contains actions
 3. GTS_PDFXVersion key missing
 4. OutputIntent for PDF/X missing
 5. OutputIntent profile not "prtr"
 6. PDF/X label missing or incorrect
 7. TrimBox or ArtBox missing
 8. Uses colour other than 4c or spot
 9. Uses transparency

While some of these are explained by the fact that it is intended for web 
delivery rather than printing, it does not give one enormous confident that the 
package works as intended.  What I would therefore like, if this is possible, 
is for an example LaTeX source file that uses the "pdfx" package and generates 
fully compliant PDF/X-1A:2003 with Xe(La)TeX as  the typesetting engine.  In 
particular I need it to generate OutputIntent with /Info other than (None) and 
OutputConditionIdentifier other than (Custom), so that I can see what a 
fully-compliant PDF/X-1A:2003 has in these metadata fields.  Also one that 
embeds an ICC color profile and XMP metadata.  If you (or any member of this 
list) has such a source file, I would be most grateful for a copy so that I can 
investigate the \specials necessary to accomplish all of these goals.

** Phil.
-- 

Philip Taylor



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Philip Taylor


Zdenek Wagner wrote:
> As I found, it is not necessary to be fully PDF/X compliant, in some cases 
> even PDF 1.5 is acceptable. It is a matter of negotiation with the printer 
> what they accept and what they do not. The good companies are able to 
> visualize the output without actually printing it so it is possible to check. 
> and they can make the proof available on their web and send the private link 
> to the customer.
Yes, that is what they have proposed, but we are asking for a hard-copy proof 
(for which we will be willing to pay, of course).
> Acrobat (at least v9) has even PDF/X profile, you can convert almost any PDF 
> to PDF/X in a single step.
Sadly I have no budget for Acrobat 9, since all work that I have done for the 
last eight years has been /pro bono/.

** Phil.
-- 

Philip Taylor



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Zdenek Wagner
2016-07-11 11:37 GMT+02:00 Ross Moore :

> Hi Zdenek,
>
> On Jul 11, 2016, at 7:03 PM, Zdenek Wagner 
> wrote:
>
> As I found, it is not necessary to be fully PDF/X compliant, in some cases
> even PDF 1.5 is acceptable. It is a matter of negotiation with the printer
> what they accept and what they do not. The good companies are able to
> visualize the output without actually printing it so it is possible to
> check. and they can make the proof available on their web and send the
> private link to the customer.
>
>
> Exactly.
> For Phil’s book it would be good to know precisely what the printers have
> requested.
>
> But for general usage into the future, we want the most flexible package
> that
> can be written, to cope with all the identifiable variables.
>
> I would like to have it too. I think it is time to prepare good interface
for package authors and users of all formats and engines.

>
>  even though the page stream is clearly not compressed:
>>
>>
>> 5 0 obj
>> <>
>> stream
>>  q 1 0 0 1 72 769.89 cm BT /F1 9.9626 Tf 19.925 -9.963
>> Td[(Hello)-333(W)82(orld!)]TJ 211.584 -654.747 Td[(1)]TJ ET Q
>>
>> endstream
>>
>> Fonts in that PDF do use compression.
>> The only other thing compressed is the XRef table.
>> When Acrobat is asked to convert to PDF/X the  xref table is uncompressed;
>> so that figures to be the real issue here.
>>
>> Interesting.  I get no such complaint for any of the 302 pages, but
>> neither am I asking Acrobat to convert the PDF to PDF/X (I would not know
>> how to) -- all I am asking Acrobat to do is (a) convert the colour space,
>> and (b) reduce the file size while making the PDF Acrobat 4+ compatible.
>> At the end of these two processes, Acrobat 7.1 pre-flight tells me the
>> result is fully PDF/X-1A:2003 compliant
>>
>
> OK. But this is after using Acrobat, yes?
> Not before.
>
> I hope that it is the matter of PDF version. If you limit the PDF version,
you will have no compression of streams. The problem is that
\pdfminorversion is understood by pdftex but AFAIK XeTeX does not send it
to xdvipdfmx. You have to use a command line switch.

>
>
> pdfx.sty can do it but it makes use of hyperref which I do not like
> because it is a big package. My document containing English + Hindi crashed
> with one version of hyperref but I was unable to prepare a minimal example
> in order to write a useful bug report. It would be nice to have an
> interface for preparation PDF/A and PDF/X without Acrobat.
>
>
> Can you send me any file that shows this?
> I’m not interested in just MWEs, but real-world examples.
>

there was a clash in macros, the document did not compile.

>
> So far I can generate Metadata in Cyrillics, Greek, Armenian, Hebrew as
> well as latin-based languages.
> At some point I plan to tackle Indic scripts as well.
> So English + Hindi is an attractive challenge.
>

I can do it in English + Czech + Hindi + Urdu in XeLaTeX without the
machinery of hyperref but in most cases hyperref works just fine for
documents containing Hindi.

>
>
> Anyway, I never include an ICC profile. I just convert the colours to CMYK
> using the right profiles and the resulting colours are exactly as I wanted.
>
>
> It’s not clear to me how important a CMYK profile really is for
> TeX-generated material.
> Mostly the CMYK colors are given algorithmically from RGB coordinates,
> so RGB would probably suffice anyway.
>
> Of course it’s a completely different story for artistic works,
> photographic or otherwise.
>

Yes, photos are my concern. So far I have produced a lot of books,
booklets, and leaflets with colour photographs. A few years ago I did an
extensive test of ICC profiles (the proofs were really printed which cost
me some money) so now I know how to convert the photos using LCMS and get
good result.

>
>
> 4.  The  \special {pdf: docinfo << … }   while valid, is *not* the
>> recommended way to
>>  provide Metadata.
>>  The modern way is via  XMP which is an XML stream using uncompressed
>> UTF-8 encoding.
>>  Some  docinfo  fields can be included also, provided they agree
>> *exactly* with what
>>  is in the XMP packet.  For things like multiple authors, and more
>> than one Keyword entry,
>>  it is best to put them into the XMP *only*.
>>
>>  Again, with PDF/X-4 and higher, this is flagged as an issue.
>>
>> Again, this is Hyperref's default behaviour; Acrobat itself then adds the
>> XMP stuff when it saves the file.
>>
>
> pdfx.sty can do it
>
> What I dislike is that pdfx has A4 size hard-wired, zwpagelayout.sty
> calculates the boxes based upon \paperheight and \paperwidth (without using
> eTeX and lua, just the old dimen registers arithmetic).
>
>
>
> Not in v.1.5.8 — at least not for PDF/X.
> That was a specific request which I responded to.
>
>  pdfx.sty  has no coding about this for  PDF/A, so far as I can see.
> Maybe it’s another of the things that hyperref does, which needs
> to be over-ridden.  I’ll look again more closely tomorrow.
>

OK, I 

Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Ross Moore
Hi Zdenek,

On Jul 11, 2016, at 7:03 PM, Zdenek Wagner 
mailto:zdenek.wag...@gmail.com>> wrote:

As I found, it is not necessary to be fully PDF/X compliant, in some cases even 
PDF 1.5 is acceptable. It is a matter of negotiation with the printer what they 
accept and what they do not. The good companies are able to visualize the 
output without actually printing it so it is possible to check. and they can 
make the proof available on their web and send the private link to the customer.

Exactly.
For Phil’s book it would be good to know precisely what the printers have 
requested.

But for general usage into the future, we want the most flexible package that
can be written, to cope with all the identifiable variables.


 even though the page stream is clearly not compressed:

5 0 obj
<>
stream
 q 1 0 0 1 72 769.89 cm BT /F1 9.9626 Tf 19.925 -9.963 
Td[(Hello)-333(W)82(orld!)]TJ 211.584 -654.747 Td[(1)]TJ ET Q

endstream

Fonts in that PDF do use compression.
The only other thing compressed is the XRef table.
When Acrobat is asked to convert to PDF/X the  xref table is uncompressed;
so that figures to be the real issue here.
Interesting.  I get no such complaint for any of the 302 pages, but neither am 
I asking Acrobat to convert the PDF to PDF/X (I would not know how to) -- all I 
am asking Acrobat to do is (a) convert the colour space, and (b) reduce the 
file size while making the PDF Acrobat 4+ compatible.  At the end of these two 
processes, Acrobat 7.1 pre-flight tells me the result is fully PDF/X-1A:2003 
compliant

OK. But this is after using Acrobat, yes?
Not before.



pdfx.sty can do it but it makes use of hyperref which I do not like because it 
is a big package. My document containing English + Hindi crashed with one 
version of hyperref but I was unable to prepare a minimal example in order to 
write a useful bug report. It would be nice to have an interface for 
preparation PDF/A and PDF/X without Acrobat.

Can you send me any file that shows this?
I’m not interested in just MWEs, but real-world examples.

So far I can generate Metadata in Cyrillics, Greek, Armenian, Hebrew as well as 
latin-based languages.
At some point I plan to tackle Indic scripts as well.
So English + Hindi is an attractive challenge.


Anyway, I never include an ICC profile. I just convert the colours to CMYK 
using the right profiles and the resulting colours are exactly as I wanted.

It’s not clear to me how important a CMYK profile really is for TeX-generated 
material.
Mostly the CMYK colors are given algorithmically from RGB coordinates,
so RGB would probably suffice anyway.

Of course it’s a completely different story for artistic works, photographic or 
otherwise.


4.  The  \special {pdf: docinfo << … }   while valid, is *not* the recommended 
way to
 provide Metadata.
 The modern way is via  XMP which is an XML stream using uncompressed UTF-8 
encoding.
 Some  docinfo  fields can be included also, provided they agree *exactly* 
with what
 is in the XMP packet.  For things like multiple authors, and more than one 
Keyword entry,
 it is best to put them into the XMP *only*.

 Again, with PDF/X-4 and higher, this is flagged as an issue.
Again, this is Hyperref's default behaviour; Acrobat itself then adds the XMP 
stuff when it saves the file.

pdfx.sty can do it

What I dislike is that pdfx has A4 size hard-wired, zwpagelayout.sty calculates 
the boxes based upon \paperheight and \paperwidth (without using eTeX and lua, 
just the old dimen registers arithmetic).


Not in v.1.5.8 — at least not for PDF/X.
That was a specific request which I responded to.

 pdfx.sty  has no coding about this for  PDF/A, so far as I can see.
Maybe it’s another of the things that hyperref does, which needs
to be over-ridden.  I’ll look again more closely tomorrow.

All of these issues are addressed, also for XeLaTeX, in the latest version 
(1.5.8)
of the  pdfx  LaTeX package.

 https://www.ctan.org/pkg/pdfx?lang=en

The package itself implements everything, (including ensuring that the correct 
color spaces are used)
and the documentation explains how to specify the (external) Metadata that you 
may wish to provide.
It has a sub-section discussing the limitations when using XeTeX as engine.
Hmmm.  Past experience suggests that LaTeX packages are no easy to get to work 
in a Plain context, but if I look at the \specials emitted that may well 
provide key information.  I know that this particular stable door was closed 
over 20 years ago, but I still wish that LaTeX were far far more modular than 
it actually is.  If only one could have a trivial wrapper such as Miniltx and 
then /any/ package could be used from within a Plain framerwork, how wonderful 
life would be.

Especially this one, it depends on a lot of files. I wanted to extract ideas 
how to build the XMP, how to include the ICC but I gave up.

XMP is done via a template file; e.g.  pdfx.xmp  or  pdfa.xmp .
There are many places where i

Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Zdenek Wagner
2016-07-11 10:36 GMT+02:00 Philip Taylor :

> Dear Ross --
>
> Ross Moore wrote:
>
> Just to summarise (for the benefit of archives and posterity), the
> following is /almost/ sufficient to achieve PDF/X-1A:2003 compliance using
> plain XeTeX.
>
> I note the /almost/.   :-)
>
> Well, yes, but far closer than I was 24 hours before !
>
> Full compliance can be achieved using Adobe Acrobat.
>
> Of course. Using the “Preflight” utility in modern Acrobat Pro, you can do
> just about
> anything with PDFs, for standards compliance and compatibility.
>
> The big problem is to do it entirely within TeX-related software,
> *without* using Acrobat Pro, except for checking that you’ve done it right.
>
> Agreed.  I would certainly like to be able to accomplish that, but with a
> 302~pp book waiting to go to press, I have to accept what is possible
> within a very limited time frame.
>

As I found, it is not necessary to be fully PDF/X compliant, in some cases
even PDF 1.5 is acceptable. It is a matter of negotiation with the printer
what they accept and what they do not. The good companies are able to
visualize the output without actually printing it so it is possible to
check. and they can make the proof available on their web and send the
private link to the customer.

> In reality, creating PDF/X-compliant documents is significantly more
> involved
> than what you have achieved so far.
>
> I am more than willing to accept that.  However, Adobe Acrobat 7.1
> pronounces my book "PDF/X-1A:2003" compliant, so I genuinely believed that
> I had achieved my goal.
>
> 1.  You should drop the  /ArtBox  completely.
>   PDF/X allows  /ArtBox  or /TrimBox  but *not both* (even if they are
> set to be the same).
>  Some applications require the /TrimBox, so this figures to be the
> best choice.
>
> Thank you, will do.
>
>
> 2.  PDF/X-1a  doesn’t like compressed object streams.
>  There is a command-line switch:   xdvipdfmx -z 0  .
>  But it results in a much larger file size in a real-world document.
>  Besides, with a document based on your example, and using this switch,
>  I cannot get Acrobat to stop complaining about compressed object
> streams,
>  even though the page stream is clearly not compressed:
>
> 5 0 obj
> <>
> stream
>  q 1 0 0 1 72 769.89 cm BT /F1 9.9626 Tf 19.925 -9.963
> Td[(Hello)-333(W)82(orld!)]TJ 211.584 -654.747 Td[(1)]TJ ET Q
>
> endstream
>
> Fonts in that PDF do use compression.
> The only other thing compressed is the XRef table.
> When Acrobat is asked to convert to PDF/X the  xref table is uncompressed;
> so that figures to be the real issue here.
>
> Interesting.  I get no such complaint for any of the 302 pages, but
> neither am I asking Acrobat to convert the PDF to PDF/X (I would not know
> how to) -- all I am asking Acrobat to do is (a) convert the colour space,
> and (b) reduce the file size while making the PDF Acrobat 4+ compatible.
> At the end of these two processes, Acrobat 7.1 pre-flight tells me the
> result is fully PDF/X-1A:2003 compliant
>
>
> Pity there is no free online PDF/X validator, like there are for PDF/A, to
> see what it might say.
> In any case, we need to be able to stop  xdvipdfmx  from producing a
> compressed XRef table.
>
>
> 3.  Your OutputIntent with  /Info(None)  and  /OutputConditionIdentifier
> (Custom)
>  is of no use to anybody or anything.  I’m surprised Acrobat doesn’t
> flag this.
>
> Ah, these must be the default values output by Hyperref in the absence of
> any other information; I can see I shall have to create a better-specified
> LaTeX source and then re-analyses the \specials that Hyperref emits.
>
>  You need to include a real ICC color profile (usually CMYK for PDF/X)
> which is
>  typically at least .5 MByte in size, often much larger.
>
> No idea how to include a colour profile, Ross; can you advise, please ?
>

pdfx.sty can do it but it makes use of hyperref which I do not like because
it is a big package. My document containing English + Hindi crashed with
one version of hyperref but I was unable to prepare a minimal example in
order to write a useful bug report. It would be nice to have an interface
for preparation PDF/A and PDF/X without Acrobat. Anyway, I never include an
ICC profile. I just convert the colours to CMYK using the right profiles
and the resulting colours are exactly as I wanted.

> 4.  The  \special {pdf: docinfo << … }   while valid, is *not* the
> recommended way to
>  provide Metadata.
>  The modern way is via  XMP which is an XML stream using uncompressed
> UTF-8 encoding.
>  Some  docinfo  fields can be included also, provided they agree
> *exactly* with what
>  is in the XMP packet.  For things like multiple authors, and more
> than one Keyword entry,
>  it is best to put them into the XMP *only*.
>
>  Again, with PDF/X-4 and higher, this is flagged as an issue.
>
> Again, this is Hyperref's default behaviour; Acrobat itself then adds the
> XMP stuff when it 

Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-11 Thread Philip Taylor
Dear Ross --

Ross Moore wrote:
> Just to summarise (for the benefit of archives and posterity), the following 
> is /almost/ sufficient to achieve PDF/X-1A:2003 compliance using plain XeTeX. 
> I note the /almost/.   :-)
Well, yes, but far closer than I was 24 hours before !
> Full compliance can be achieved using Adobe Acrobat.
> Of course. Using the “Preflight” utility in modern Acrobat Pro, you can do 
> just about
> anything with PDFs, for standards compliance and compatibility.
>
> The big problem is to do it entirely within TeX-related software, 
> *without* using Acrobat Pro, except for checking that you’ve done it right.
Agreed.  I would certainly like to be able to accomplish that, but with a 
302~pp book waiting to go to press, I have to accept what is possible within a 
very limited time frame.
> In reality, creating PDF/X-compliant documents is significantly more involved
> than what you have achieved so far.
I am more than willing to accept that.  However, Adobe Acrobat 7.1 pronounces 
my book "PDF/X-1A:2003" compliant, so I genuinely believed that I had achieved 
my goal.
> 1.  You should drop the  /ArtBox  completely.
>   PDF/X allows  /ArtBox  or /TrimBox  but *not both* (even if they are 
> set to be the same).
>  Some applications require the /TrimBox, so this figures to be the best 
> choice.
Thank you, will do.
>
> 2.  PDF/X-1a  doesn’t like compressed object streams.
>  There is a command-line switch:   xdvipdfmx -z 0  .
>  But it results in a much larger file size in a real-world document.
>  Besides, with a document based on your example, and using this switch,
>  I cannot get Acrobat to stop complaining about compressed object streams,
>  even though the page stream is clearly not compressed:
>
> 5 0 obj
> <>
> stream
>  q 1 0 0 1 72 769.89 cm BT /F1 9.9626 Tf 19.925 -9.963 
> Td[(Hello)-333(W)82(orld!)]TJ 211.584 -654.747 Td[(1)]TJ ET Q
>
> endstream
>
> Fonts in that PDF do use compression.
> The only other thing compressed is the XRef table.
> When Acrobat is asked to convert to PDF/X the  xref table is uncompressed;
> so that figures to be the real issue here. 
Interesting.  I get no such complaint for any of the 302 pages, but neither am 
I asking Acrobat to convert the PDF to PDF/X (I would not know how to) -- all I 
am asking Acrobat to do is (a) convert the colour space, and (b) reduce the 
file size while making the PDF Acrobat 4+ compatible.  At the end of these two 
processes, Acrobat 7.1 pre-flight tells me the result is fully PDF/X-1A:2003 
compliant
>
> Pity there is no free online PDF/X validator, like there are for PDF/A, to 
> see what it might say.
> In any case, we need to be able to stop  xdvipdfmx  from producing a 
> compressed XRef table.
>
>
> 3.  Your OutputIntent with  /Info(None)  and  /OutputConditionIdentifier 
> (Custom) 
>  is of no use to anybody or anything.  I’m surprised Acrobat doesn’t flag 
> this.
Ah, these must be the default values output by Hyperref in the absence of any 
other information; I can see I shall have to create a better-specified LaTeX 
source and then re-analyses the \specials that Hyperref emits.
>  You need to include a real ICC color profile (usually CMYK for PDF/X) 
> which is
>  typically at least .5 MByte in size, often much larger.
No idea how to include a colour profile, Ross; can you advise, please ?
> 4.  The  \special {pdf: docinfo << … }   while valid, is *not* the 
> recommended way to
>  provide Metadata.  
>  The modern way is via  XMP which is an XML stream using uncompressed 
> UTF-8 encoding.
>  Some  docinfo  fields can be included also, provided they agree 
> *exactly* with what
>  is in the XMP packet.  For things like multiple authors, and more than 
> one Keyword entry,
>  it is best to put them into the XMP *only*.
>
>  Again, with PDF/X-4 and higher, this is flagged as an issue.
Again, this is Hyperref's default behaviour; Acrobat itself then adds the XMP 
stuff when it saves the file.
> All of these issues are addressed, also for XeLaTeX, in the latest version 
> (1.5.8) 
> of the  pdfx  LaTeX package.
>
>  https://www.ctan.org/pkg/pdfx?lang=en
>
> The package itself implements everything, (including ensuring that the 
> correct color spaces are used) 
> and the documentation explains how to specify the (external) Metadata that 
> you may wish to provide.
> It has a sub-section discussing the limitations when using XeTeX as engine.
Hmmm.  Past experience suggests that LaTeX packages are no easy to get to work 
in a Plain context, but if I look at the \specials emitted that may well 
provide key information.  I know that this particular stable door was closed 
over 20 years ago, but I still wish that LaTeX were far far more modular than 
it actually is.  If only one could have a trivial wrapper such as Miniltx and 
then /any/ package could be used from within a Plain framerwork, how wonderful 
life would be.
> Although a LaTe

Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Ross Moore
Hi Phil,

On Jul 11, 2016, at 3:40 AM, Philip Taylor 
mailto:p.tay...@rhul.ac.uk>> wrote:

Just to summarise (for the benefit of archives and posterity), the following is 
/almost/ sufficient to achieve PDF/X-1A:2003 compliance using plain XeTeX.

I note the /almost/.   :-)

Full compliance can be achieved using Adobe Acrobat.

Of course. Using the “Preflight” utility in modern Acrobat Pro, you can do just 
about
anything with PDFs, for standards compliance and compatibility.

The big problem is to do it entirely within TeX-related software,
*without* using Acrobat Pro, except for checking that you’ve done it right.

In reality, creating PDF/X-compliant documents is significantly more involved
than what you have achieved so far.


\newif \ifpdfxa
\pdfxatrue

\ifpdfxa
\special {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
\special {pdf: docinfo << /GTS_PDFXVersion (PDF/X-1:2001) 
/GTS_PDFXConformance (PDF/X-1a:2001) >>}
\special {pdf: put @catalog << /PageMode /UseNone /OutputIntents [ << /Info 
(none) /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier (Custom) 
/RegistryName (http://www.color.org/) >> ] >>}
\special {pdf: dest (page.1) [@thispage /XYZ @xpos @ypos null]}
\special {pdf: docinfo << /Title(Document Title)/Subject(Some 
subject)/Creator(XeTeX)/ModDate(D:mmddhhmmss)/Author(Your 
Name)/Producer(XeTeX version)/Keywords(Whatever)/Trapped/False >>}
\fi

Using this there are several deficiencies.

1.  You should drop the  /ArtBox  completely.
  PDF/X allows  /ArtBox  or /TrimBox  but *not both* (even if they are set 
to be the same).
 Some applications require the /TrimBox, so this figures to be the best 
choice.

2.  PDF/X-1a  doesn’t like compressed object streams.
 There is a command-line switch:   xdvipdfmx -z 0  .
 But it results in a much larger file size in a real-world document.
 Besides, with a document based on your example, and using this switch,
 I cannot get Acrobat to stop complaining about compressed object streams,
 even though the page stream is clearly not compressed:

5 0 obj
<>
stream
 q 1 0 0 1 72 769.89 cm BT /F1 9.9626 Tf 19.925 -9.963 
Td[(Hello)-333(W)82(orld!)]TJ 211.584 -654.747 Td[(1)]TJ ET Q

endstream

Fonts in that PDF do use compression.
The only other thing compressed is the XRef table.
When Acrobat is asked to convert to PDF/X the  xref table is uncompressed;
so that figures to be the real issue here.

Pity there is no free online PDF/X validator, like there are for PDF/A, to see 
what it might say.
In any case, we need to be able to stop  xdvipdfmx  from producing a compressed 
XRef table.


3.  Your OutputIntent with  /Info(None)  and  /OutputConditionIdentifier 
(Custom)
 is of no use to anybody or anything.  I’m surprised Acrobat doesn’t flag 
this.

 You need to include a real ICC color profile (usually CMYK for PDF/X) 
which is
 typically at least .5 MByte in size, often much larger.

 Upon checking for PDF/X-4 and higher levels, this *is* flagged as an issue.


4.  The  \special {pdf: docinfo << … }   while valid, is *not* the recommended 
way to
 provide Metadata.
 The modern way is via  XMP which is an XML stream using uncompressed UTF-8 
encoding.
 Some  docinfo  fields can be included also, provided they agree *exactly* 
with what
 is in the XMP packet.  For things like multiple authors, and more than one 
Keyword entry,
 it is best to put them into the XMP *only*.

 Again, with PDF/X-4 and higher, this is flagged as an issue.


All of these issues are addressed, also for XeLaTeX, in the latest version 
(1.5.8)
of the  pdfx  LaTeX package.
 https://www.ctan.org/pkg/pdfx?lang=en

The package itself implements everything, (including ensuring that the correct 
color spaces are used)
and the documentation explains how to specify the (external) Metadata that you 
may wish to provide.
It has a sub-section discussing the limitations when using XeTeX as engine.

Although a LaTeX package, you can check the source coding to find out how issues
are addressed. Look in particular for  \ifxetex  sections.
Most of the coding is straightforward TeX macro programming.
Though it does use LaTeX’s \IfFileExists  construction, to check that 
appropriate resources
are available.
(And it loads  hyperref  to get access to some of its features, but also to 
cancel some
 other features that might conflict with how  pdfx  is handling the Metadata.)



The caveats are as follows :

  1.  a hook will need to be inserted into \shipout to insert the bounding 
boxes on each page;

  pdfx.sty  uses\RequirePackage{everyshi}  and  \EveryShipout  

Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor
Thank you Jonathan; a great improvement, and one much appreciated.

Jonathan Kew wrote:
> You could avoid the untidiness of #5 if you hook in \setboundingboxes 
> differently, such that it's actually inserted into what is being shipped out, 
> rather than added to the MVL to become part of the next page. E.g. if you're 
> using the plain.tex \output routine, you could just sneak it onto the start 
> of \makeheadline:
>
> \let \Makeheadline = \makeheadline
> \def \makeheadline {\setboundingboxes \Makeheadline}
>
> Then every page should get the desired settings, AFAICS, without needing to 
> do it manually on the first page (and without needing an explicit page count 
> in the source).
** Phil.
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Jonathan Kew

Hi Phil,

On 10/7/16 18:40, Philip Taylor wrote:

The caveats are as follows :

 1. a hook will need to be inserted into \shipout to insert the bounding
boxes on each page;
 2. the colours will need to be converted to the desired output profile
using Adobe Acrobat;
 3. the file will need to be reduced in size with Acrobat 4+
compatibility but with no image compression in order to convert it
to PDF 1.3;
 4. the dimensions of the bounding boxes are for B5 in so-called "big
points" (Postscript points) and will need to be amended for other
page sizes;
 5. \setboundingboxes will have to be called explicitly for the first
page only.


You could avoid the untidiness of #5 if you hook in \setboundingboxes 
differently, such that it's actually inserted into what is being shipped 
out, rather than added to the MVL to become part of the next page. E.g. 
if you're using the plain.tex \output routine, you could just sneak it 
onto the start of \makeheadline:


\let \Makeheadline = \makeheadline
\def \makeheadline {\setboundingboxes \Makeheadline}

Then every page should get the desired settings, AFAICS, without needing 
to do it manually on the first page (and without needing an explicit 
page count in the source).


JK



--
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor
Just to summarise (for the benefit of archives and posterity), the following is 
/almost/ sufficient to achieve PDF/X-1A:2003 compliance using plain XeTeX.  
Full compliance can be achieved using Adobe Acrobat.
> \newif \ifpdfxa
> \pdfxatrue
>
> \ifpdfxa
> \special {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
> \special {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
> \special {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
> \special {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
> \special {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
> \special {pdf: docinfo << /GTS_PDFXVersion (PDF/X-1:2001) 
> /GTS_PDFXConformance (PDF/X-1a:2001) >>}
> \special {pdf: put @catalog << /PageMode /UseNone /OutputIntents [ << 
> /Info (none) /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier 
> (Custom) /RegistryName (http://www.color.org/) >> ] >>}
> \special {pdf: dest (page.1) [@thispage /XYZ @xpos @ypos null]}
> \special {pdf: docinfo << /Title(Document Title)/Subject(Some 
> subject)/Creator(XeTeX)/ModDate(D:mmddhhmmss)/Author(Your 
> Name)/Producer(XeTeX version)/Keywords(Whatever)/Trapped/False >>}
> \fi
The caveats are as follows :

 1. a hook will need to be inserted into \shipout to insert the bounding boxes 
on each page;
 2. the colours will need to be converted to the desired output profile using 
Adobe Acrobat;
 3. the file will need to be reduced in size with Acrobat 4+ compatibility but 
with no image compression in order to convert it to PDF 1.3;
 4. the dimensions of the bounding boxes are for B5 in so-called "big points" 
(Postscript points) and will need to be amended for other page sizes;
 5. \setboundingboxes will have to be called explicitly for the first page only.

\shipout can be hooked as follows :

\def \setboundingboxes
{%
\special {pdf: put @thispage << /ArtBox [0 0 498.89641  708.65968] 
>>}%
\special {pdf: put @thispage << /BleedBox [0 0 498.89641  
708.65968] >>}%
\special {pdf: put @thispage << /CropBox [0 0 498.89641  708.65968] 
>>}%
\special {pdf: put @thispage << /MediaBox [0 0 498.89641  
708.65968] >>}%
\special {pdf: put @thispage << /TrimBox [0 0 498.89641  708.65968] 
>>}%
}
  
\newcount \maxpage
\maxpage = 
\let \Shipout = \shipout
\def \shipout {\ifnum \pageno < \maxpage \setboundingboxes \fi \Shipout}
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor


Philip Taylor wrote:
> I am completely confused in that I am no longer seeing the XML metadata in 
> the PDF file even having (a) commented those two lines out, and then (b) 
> replaced the entire LaTeX source with a clean copy taken from the web.  
> Probably too tired to think straight :-(
OK, I was (and am) too tired to think straight, but now I understand what is 
going on.  The XML metadata are /added by Adobe Acrobat/, when I use File / 
Reduce file size / For Acrobat 4 in order to bring the PDF version down to 1.3. 
 Which means (I am delighted to be able to report) that the following does 
indeed achieve what was/is intended :

% !TeX Program = XeTeX
% !TeX Root = For-JK.tex
% !TeX Project = An Oral History of Horsmonden

\newif \ifpdfxa
\pdfxatrue

\ifpdfxa
\special {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
\special {pdf: docinfo << /GTS_PDFXVersion (PDF/X-1:2001) 
/GTS_PDFXConformance (PDF/X-1a:2001) >>}
\special {pdf: put @catalog << /PageMode /UseNone /OutputIntents [ << /Info 
(none) /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier (Custom) 
/RegistryName (http://www.color.org/) >> ] >>}
\special {pdf: dest (page.1) [@thispage /XYZ @xpos @ypos null]}
\special {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
\special {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
\special {pdf: docinfo << 
/Title(DocTitle)/Subject()/Creator(XeTeX)/ModDate(D:20160710164300)/Author(Philip
 Taylor)/Producer(XeTeX 0.6)/Keywords(PDF specials)/Trapped/False >>}
\fi

\leavevmode
\end

My sincere thanks to Jonathan, for his suggestion which inspired my solution, 
and to Apostolos, Zdeněk and others who have tried to help.

** Phil.
-- 

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor


Philip Taylor wrote:
> Thank you Jonathan -- that may have led me to a solution.  I could generate 
> the .xdv with no problem, but even looking at it using DVIASM did not give me 
> sufficient information to work out what \specials might exist.  So instead I 
> added the following to my XeLaTeX code :
>
> \let \Special = \special
> \def \special #1{\message {\string \special: [#1]\Special {#1}}}
Slight typo. in preceding, should read :

\let \Special = \special
\def \special #1{\message {\string \special: [#1]}\Special {#1}}

but now I am completely confused in that I am no longer seeing the XML metadata 
in the PDF file even having (a) commented those two lines out, and then (b) 
replaced the entire LaTeX source with a clean copy taken from the web.  
Probably too tired to think straight :-(




--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Zdenek Wagner
I have the following code in zwpagelayout.sty:

\edef\zwpl@pdftitle{\zwpl@title}
\ifcat$\zwpl@pdftitle$
  \ifzwpl@pdfx
\ifcase\zwpl@Driver
\or
  \pdfinfo{\zwpl@pdfinfo}
\or
  \ifxetex \def\zwpl@crt{XeTeX}\else \def\zwpl@crt{TeX+dvipdfm}\fi
  \edef\zwpl@pdfcrt{ /Creator (\zwpl@crt) }
  \special{pdf:docinfo << \zwpl@pdfmoddate \zwpl@pdfcrt  \zwpl@pdfxinfo >>}
\fi
  \fi
\else
  \edef\zwpl@pdftitle{/Title (\zwpl@pdftitle)}
  \ifcat$\zwpl@author$\def\zwpl@pdfauthor{}\else
\edef\zwpl@pdfauthor{ /Author (\zwpl@author)}\fi
  \ifcat$\zwpl@subject$\def\zwpl@pdfsubject{}\else
\edef\zwpl@pdfsubject{ /Subject (\zwpl@subject)}\fi
  \ifcat$\zwpl@keywords$\def\zwpl@pdfkeywords{}\else
\edef\zwpl@pdfkeywords{ /Keywords (\zwpl@keywords)}\fi
  \edef\zwpl@pdfcreationdate{ /CreationDate \zwpl@modt}
  \edef\zwpl@pdfmoddate{ /ModDate \zwpl@modt}
  \ifcase\zwpl@Driver
  \or
\pdfinfo{\zwpl@pdftitle \zwpl@pdfauthor \zwpl@pdfsubject
\zwpl@pdfkeywords \zwpl@pdfxinfo}
  \or
\ifxetex \def\zwpl@crt{XeTeX}\else \def\zwpl@crt{TeX+dvipdfm}\fi
\edef\zwpl@pdfcrt{ /Creator (\zwpl@crt) }
\special{pdf:docinfo << \zwpl@pdftitle \zwpl@pdfauthor
\zwpl@pdfsubject \zwpl@pdfkeywords
\zwpl@pdfmoddate \zwpl@pdfcrt  \zwpl@pdfxinfo >>}
  \else
\def\zwpl@pdfcrt{ /Creator (TeX+dvips) }
\special{ps:[ \zwpl@pdftitle \zwpl@pdfauthor \zwpl@pdfsubject
\zwpl@pdfkeywords
  \zwpl@pdfcreationdate \zwpl@pdfmoddate \zwpl@pdfcrt
/DOCINFO pdfmark}
  \fi
\fi

I can see the texts in pdfinfo as well as in Acrobat.

Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz


2016-07-10 17:38 GMT+02:00 Philip Taylor :
>
> Jonathan Kew wrote:
>> [Y]ou could generate a minimal .xdv file with xelatex (using -no-pdf) and 
>> then examine this with a binary-capable editor/viewer to see what pdf 
>> specials have been inserted. Then write plain-based code to generate the 
>> same in your xetex document.
>
> Thank you Jonathan -- that may have led me to a solution.  I could generate 
> the .xdv with no problem, but even looking at it using DVIASM did not give me 
> sufficient information to work out what \specials might exist.  So instead I 
> added the following to my XeLaTeX code :
>
> \let \Special = \special
> \def \special #1{\message {\string \special: [#1]\Special {#1}}}
>
> and this yields in the transcript :
>
> \special: [pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] 
> >>]\Specia
> l {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] 
> >>]\Special
>  {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] 
> >>]\Specia
> l {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] 
> >>]\Special
>  {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
> \special: [pdf:docinfo << /GTS_PDFXVersion (PDF/X-1:2001) /GTS_PDFXConformance
> (PDF/X-1a:2001) >> ]\Special {pdf:docinfo << /GTS_PDFXVersion (PDF/X-1:2001) 
> /G
> TS_PDFXConformance (PDF/X-1a:2001) >> }
> \special: [pdf:put @catalog << /PageMode /UseNone /OutputIntents [ << /Info 
> (no
> ne) /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier (Custom) 
> /Regis
> tryName (http://www.color.org/) >> ] >> ]\Special {pdf:put @catalog << 
> /PageMod
> e /UseNone /OutputIntents [ << /Info (none) /Type /OutputIntent /S /GTS_PDFX 
> /O
> utputConditionIdentifier (Custom) /RegistryName (http://www.color.org/) >> ] 
> >>
>  } (d:/TeX/Live/2014/texmf-dist/tex/generic/oberdiek/se-ascii-print.def)
> \special: [pdf:dest (page.1) [@thispage /XYZ @xpos @ypos null]]\Special 
> {pdf:de
> st (page.1) [@thispage /XYZ @xpos @ypos null]}
> \special: [pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>]\Special
> {pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] 
> >>]\Specia
> l {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] 
> >>]\Special
>  {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] 
> >>]\Specia
> l {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
> \special: [pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] 
> >>]\Special
>  {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
> \special: [pdf:docinfo< package)/ModDate(D:20160710163100)/Author()/Producer(XeTeX 
> 0.6)/Keywords()/
> Trapped/False>>]\Special 
> {pdf:docinfo<  with hyperref package)/ModDate(D:20160710163100)/Author()/Producer(XeTeX 
> 0

Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor

Jonathan Kew wrote:
> [Y]ou could generate a minimal .xdv file with xelatex (using -no-pdf) and 
> then examine this with a binary-capable editor/viewer to see what pdf 
> specials have been inserted. Then write plain-based code to generate the same 
> in your xetex document.

Thank you Jonathan -- that may have led me to a solution.  I could generate the 
.xdv with no problem, but even looking at it using DVIASM did not give me 
sufficient information to work out what \specials might exist.  So instead I 
added the following to my XeLaTeX code :

\let \Special = \special
\def \special #1{\message {\string \special: [#1]\Special {#1}}}

and this yields in the transcript :

\special: [pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>]\Special
{pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>]\Specia
l {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>]\Special
 {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>]\Specia
l {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>]\Special
 {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
\special: [pdf:docinfo << /GTS_PDFXVersion (PDF/X-1:2001) /GTS_PDFXConformance
(PDF/X-1a:2001) >> ]\Special {pdf:docinfo << /GTS_PDFXVersion (PDF/X-1:2001) /G
TS_PDFXConformance (PDF/X-1a:2001) >> }
\special: [pdf:put @catalog << /PageMode /UseNone /OutputIntents [ << /Info (no
ne) /Type /OutputIntent /S /GTS_PDFX /OutputConditionIdentifier (Custom) /Regis
tryName (http://www.color.org/) >> ] >> ]\Special {pdf:put @catalog << /PageMod
e /UseNone /OutputIntents [ << /Info (none) /Type /OutputIntent /S /GTS_PDFX /O
utputConditionIdentifier (Custom) /RegistryName (http://www.color.org/) >> ] >>
 } (d:/TeX/Live/2014/texmf-dist/tex/generic/oberdiek/se-ascii-print.def)
\special: [pdf:dest (page.1) [@thispage /XYZ @xpos @ypos null]]\Special {pdf:de
st (page.1) [@thispage /XYZ @xpos @ypos null]}
\special: [pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>]\Special
{pdf: put @thispage << /ArtBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>]\Specia
l {pdf: put @thispage << /BleedBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>]\Special
 {pdf: put @thispage << /CropBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>]\Specia
l {pdf: put @thispage << /MediaBox [0 0 498.89641 708.65968] >>}
\special: [pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>]\Special
 {pdf: put @thispage << /TrimBox [0 0 498.89641 708.65968] >>}
\special: [pdf:docinfo<>]\Special {pdf:docinfo<>}

Obviously that will require massaging to rejoin the fractured lines, but it 
will be interesting to see whether it then yields viable Plain XeTeX code.  I 
sdhall; report back.



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Jonathan Kew

On 10/7/16 13:28, Philip Taylor wrote:

Oops, missed that Zdeněk  , but even after correcting the error the
diagnostics remain the same.   I have a work-around (I generate a
one-page PDF using XeLaTeX with the necessary metadata and then
append the real PDF); the result is PDF/X-1A compliant, but the
printer will have to be instructed not to print page one, so I would
prefer a cleaner solution



Presumably, hyperref accomplishes its thing by inserting some kind of 
\special, so it should be possible, at least in principle, to examine 
the code to see what it's generating and then reproduce that using plain 
commands.


Or alternatively, given that trawling through hyperref's macros may be 
heavy going, you could generate a minimal .xdv file with xelatex (using 
-no-pdf) and then examine this with a binary-capable editor/viewer to 
see what pdf specials have been inserted. Then write plain-based code to 
generate the same in your xetex document.


JK


Zdenek Wagner wrote:

Hi Philip,

you have a space between a slash and ModDate.


\special {pdf: docinfo <<

/Author (John Holmes)

/Title (Math Everywhere).

/ModDate (D:0)

/Trapped (False)


}





-- Subscriptions,
Archive, and List information, etc.:
http://tug.org/mailman/listinfo/xetex





--
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor
Oops, missed that Zdeněk  , but even after correcting the error the diagnostics 
remain the same.   I have a work-around (I generate a one-page PDF using 
XeLaTeX with the necessary metadata and then append the real PDF); the result 
is PDF/X-1A compliant, but the printer will have to be instructed not to print 
page one, so I would prefer a cleaner solution

Zdenek Wagner wrote:
> Hi Philip,
>
> you have a space between a slash and ModDate. 

\special {pdf: docinfo <<

/Author (John Holmes)

/Title (Math Everywhere).

/ModDate (D:0)

/Trapped (False)

>>}




--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Zdenek Wagner
Hi Philip,

you have a space between a slash and ModDate. This is a syntax error
(<< >> require key/value pairs) and this may be the reason why the
contents is ignored.
Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz


2016-07-10 13:43 GMT+02:00 Philip Taylor :
>
>
> Apostolos Syropoulos wrote:
>
> I would use something like the following;
>
> \special{pdf: docinfo <<
>   /Author (John Holmes)
>  /Title (Math Everywhere)
> 
>>>}
>
> Sadly not, Apostole -- as far as Adobe Acrobat pre-flight checks are
> concerned,
>
> \special {pdf: docinfo <<
>
> /Author (John Holmes)
>
> /Title (Math Everywhere).
>
> / ModDate (D:0)
>
> /Trapped (False)
>
>>>}
>
> does not generate the same information as
>
> \hypersetup
>
> {%
>
> pdftitle = {DocTitle},% PDF/X document should have a title
>
> pdfinfo =
>
> {% Setting some more PDF/X stuff for xelatex
>
> ModDate={D:\pdfdate},% PDF/X document should have a modification date
>
> Trapped={False},% PDF/X document should have Trapped tag set
>
> }
>
> }
>
> and all of Document modification date, Document title and Trapped key are
> reported as missing, empty or defective.
>
> ** Phil.
>
>
>
>
> --
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor


Apostolos Syropoulos wrote:
> I would use something like the following;
>
> \special{pdf: docinfo <<
>   /Author (John Holmes)
>  /Title (Math Everywhere)
> 
> >>}
Sadly not, Apostole -- as far as Adobe Acrobat pre-flight checks are concerned,

> \special {pdf: docinfo <<
>
> /Author (John Holmes)
>
> /Title (Math Everywhere).
>
> / ModDate (D:0)
>
> /Trapped (False)
>
> >>}
>
does not generate the same information as

> \hypersetup
>
> {%
>
> pdftitle = {DocTitle},% PDF/X document should have a title
>
> pdfinfo =
>
> {% Setting some more PDF/X stuff for xelatex
>
> ModDate={D:\pdfdate},% PDF/X document should have a modification date
>
> Trapped={False},% PDF/X document should have Trapped tag set
>
> }
>
> }
>
and all of Document modification date, Document title and Trapped key are 
reported as missing, empty or defective.

** Phil.



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Σχετ: Plain XeTeX, pdftitle, pdfinfo

2016-07-10 Thread Philip Taylor
Thank you Apostolos -- I will try that and report back.
Philip Taylor

Apostolos Syropoulos wrote:
> I would use something like the following;
>
> \special{pdf: docinfo <<
>   /Author (John Holmes)
>  /Title (Math Everywhere)
> 
> >>}
>
> Apostolos



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex