<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Hi Philip,<br>
<br>
<div class="moz-cite-prefix">On 29.05.21 11:22, Philip Taylor wrote:<br>
</div>
<blockquote type="cite"
cite="mid:2e6dc88b-4b86-96b3-6ff1-5e235bcd945d@Hellenic-Institute.Uk">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Hallo Akira-san, and many thanks for
the information. As far as I can see, the real problem lies in
the fact that "only documents opened by `pdfopen' can be closed
by `pdfclose'" [This is a problem because TeXworks appears not
to use `pdfopen' when instructed to "Print PDF..."]. I assume
that this restriction exists because `pdfopen' obtains some sort
of descriptor/handle to the file which it has opened, which it
then uses to close the file, but I have checked and ascertained
that MS Word does not suffer from this problem — I can open a
Word-generated PDF by double-clicking on it in Windows Explorer,
and if I then open the original Word document and tell it to
"Save as PDF", Word manages to tell Adobe Acrobat to close the
file even though it did not initiate the open. I therefore have
two questions :<br>
<ol>
<li>Is there any possibility that `pdfclose' could be enhanced
such that `pdfclose' can open any currently open PDF, not
just one that it has itself opened; and</li>
</ol>
</div>
</blockquote>
<br>
In principle, yes (if I understand you correctly) - at least for
Acrobat. <a class="moz-txt-link-freetext" href="https://www.adobe.com/go/acrobatsdk_iacguide">https://www.adobe.com/go/acrobatsdk_iacguide</a> lists a
CloseAllDocs() function. There doesn't seem to be an easy way to get
a list of all open files, though.<br>
<br>
<blockquote type="cite"
cite="mid:2e6dc88b-4b86-96b3-6ff1-5e235bcd945d@Hellenic-Institute.Uk">
<div class="moz-cite-prefix">
<ol>
<li>Would it be possible to develop a `pdfDDE' program that
would iterate over the known set of DDE server names and
report which (if any) allow successful communication with
the server, as determining the DDE server name appears to be
somewhat problematic ?</li>
</ol>
</div>
</blockquote>
<br>
Yes, it seems to be possible to communicate with all DDE-aware
applications (see
<a class="moz-txt-link-freetext" href="https://docs.microsoft.com/en-us/windows/win32/dataxchg/using-dynamic-data-exchange">https://docs.microsoft.com/en-us/windows/win32/dataxchg/using-dynamic-data-exchange</a>).
However, many of them may not be PDF readers, and their way of
communicating (supported commands, etc.) are application-specific as
well. So without knowing what to look for, it seems impossible to
actually find something useful.<br>
That being said, according to
<a class="moz-txt-link-freetext" href="https://wiki.tcl-lang.org/page/Howto+open+PDF+with+Adobe+Acrobat+or+Reader+using+DDE">https://wiki.tcl-lang.org/page/Howto+open+PDF+with+Adobe+Acrobat+or+Reader+using+DDE</a>,
it might be possible to determine the DDE name of a (properly
installed) Acrobat version from the registry (assuming the syntax
doesn't change from version to version).<br>
<br>
<blockquote type="cite"
cite="mid:2e6dc88b-4b86-96b3-6ff1-5e235bcd945d@Hellenic-Institute.Uk">
<div class="moz-cite-prefix">
<ol>
</ol>
<p>In the meantime I will raise this issue on the TeXworks list,
since if TeXworks could use `pdfopen' and `pdfclose' (the
former when instructed to "Print PDF...", the latter before
calling XeTeX), then that would address at least a part of the
current problem.<br>
</p>
</div>
</blockquote>
<br>
I'm reluctant to force the use of pdfopen, as this is a separate
program/script that need not be installed (it definitely isn't on my
(Linux) system). I could imagine, though, implementing the
possibility to run certain commands before typesetting, such as
sending DDE command to Acrobat on Windows), similar to what I think
is done in TeXnicCenter and probably others.<br>
<br>
Does anyone have any experience with other PDF readers? Is the same
problem (no write access to open pdfs) present in, e.g.,
FoxitReader, SumatraPDF, etc.? Or is it just Adobe-specific?<br>
<br>
HTH<br>
Stefan<br>
</body>
</html>