Re: rst2html link to given page in pdf document

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=LRuJ_71CtcQJSOyCcQ-69kjigHkD=KXJANHbAKg2oK5Q@mail.gmail.com>
On Jun 6, 2014 5:18 PM, "Alan Bromborsky" <[email protected]> wrote:
>
> On 06/06/2014 05:52 PM, David Goodger wrote:
>>
>> On Fri, Jun 6, 2014 at 9:40 AM, Alan Bromborsky <[email protected]>
wrote:
>>>
>>> I wish to link to a given page in a pdf document from the html document
>>> generated by rst2html:
>>>
>>> The following works (in the rst file) - :download:`GA
>>> <../LaTeX_docs/GA.pdf>`
>>> to open GA.pdf at the beginning.
>>> The following does not work - :download:`GA
<../LaTeX_docs/GA.pdf#page=12>`
>>> to open GA.pdf at page 12. However if I use - :download:`GA
>>> <../LaTeX_docs/GA.pdf>`
>>> in the rst file and then change - _downloads/GA.pdf
>>> in the html file to - _downloads/GA.pdf#page=12
>>> then the link does open on page 12. Do you know of anyway to code this
>>> directly in the rst file?
>>
>> What does ":download:`URL`" do? I've never seen that before.
>>
>> Putting "#page=12" into the RST source ought to work fine, and it
>> would if it were a simple link (without the :download: part, e.g. just
>> "`GA <../LaTeX_docs/GA.pdf#page=12>`_". This produces the following
>> HTML:
>>
>> <a class="reference external" href="../LaTeX_docs/GA.pdf#page=12">GA</a>
>>
>> Please show us the HTML output you get, when you include that parameter.
>>
>
> Note that my rst file is processed with python-sphinx.

I can't help you with Sphinx-specific markup ("download"), sorry. Perhaps
ask on the Sphinx list.

>  The rst text and the resulting html output is shown below
>
> rst html
>
> `GA <../LaTeX_docs/GA.pdf>`

Note that you need a trailing underscore for this to work. See my example
above.

DG

> <cite>GA &lt;../LaTeX_docs/GA.pdf&gt;</cite>
> :download:`GA <../LaTeX_docs/GA.pdf>`                               <a
class="reference download internal" href="_downloads/GA.pdf"><tt
class="xref download docutils literal"><span
class="pre">GA</span></div>:download:`GA <../LaTeX_docs/GA.pdf#page=12>`
<tt class="xref download docutils literal"><span class="pre">GA</span>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.