Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   Realm Works Discussion (http://forums.wolflair.com/forumdisplay.php?f=67)
-   -   Direct link to a pdf page (http://forums.wolflair.com/showthread.php?t=53210)

Bobifle June 19th, 2015 11:55 AM

Direct link to a pdf page
 
Hi,

I'm trying to create link/hyperlinks to a pdf document I've added in a topic.

1/ the only auto link created by RW points to the topic containing the pdf, not the pdf itself
2/ I tried to create in a snippet an hyperlink with an url pointing to my local drive pdf. But it's not supported.


Before opening a feature request, I'd like to know if anyone has achieved such feature ?

For instance:

snippet:
"The player uses a new discipline called The Ultimate discipline of death (core rule book#page=290)"

Edit : any way to bypass the 30 Mb file size ?

Vargr June 19th, 2015 01:08 PM

You can add a new snippet in your topic and then choose

Documents and Media / PDF Document

That will enable you to have a link to a PDF.

I believe the PDF will be imbedded, not sure though.

I am planning to play around with that one of these days, for a need a link that will open an external file with the windows default program for that type of file. Ie. a link to a non-imbedded file.

Parody June 19th, 2015 01:21 PM

1 Attachment(s)
Quote:

Originally Posted by Bobifle (Post 211127)
I'm trying to create link/hyperlinks to a pdf document I've added in a topic.

As you've found, you can't link into an attached PDF file. What I do is use a special Source Tag Snippet:

Attachment 3866

The book name is one of the Tags and the page(s) go into the text field. If the Topic/Article uses more than one book, then I add another Source snippet.


Quote:

Originally Posted by Bobifle (Post 211127)
any way to bypass the 30 Mb file size ?

Nope. LWD would have to change that limit. It's also a good idea to not clog up your multi-machine, multi-platform database with files you likely use independently from that database. (I use my rulebooks and modules all the time away from Realm Works.)


Quote:

Originally Posted by Bobifle (Post 211127)
2/ I tried to create in a snippet an hyperlink with an url pointing to my local drive pdf. But it's not supported.

It is very much not supported. Keeping local files separated from your multi-machine, multi-platform database is also a good idea.

However, while I don't recommend doing so, you can use batch files and Foreign Object snippets to do some local automation in Realm Works. They'll only work on one machine, unless you can ensure that all paths are identical on multiple machines.

To open an external PDF to a specified page, you need to create a batch file. It only needs one line:

Code:

"E:\Program Files\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe" /A "page=N" "c:\full\path\to\file.pdf"
The first part is the full path to your copy of Acrobat or Adobe Reader. (The example is where I installed Acrobat Pro X.)

/A is the Actions command. In the following string, replace N with the page number. It needs to be an integer index so if, for example, your PDF says the first page number is "Front Cover" you may have to add or subtract a couple to find the right one.

The last part is the full path to the PDF file.


Run the batch file and see if it works. Once you have the batch file opening the PDF to the right place, then you can attach the batch file to a Foreign Object snippet in Realm Works. When you use the "play" button to "view" it, Realm Works will write the batch file to your Temp folder and run it, which should open the file for you.

Vargr June 19th, 2015 01:26 PM

Quote:

Originally Posted by Parody (Post 211137)
To open a PDF to a specified page, you need to create a batch file. It only needs one line:

Code:

E:\Program Files\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe /A "page=N" "c:\full\path\to\file.pdf"
The first part is the full path to your copy of Acrobat or Adobe Reader. (The example is where I installed Acrobat Pro X.)

/A is the Actions command. In the following string, replace N with the page number. (It needs to be an integer index so if, for example, your PDF says the first page number is "Front Cover" you may have to add or subtract a couple to find the right one.)

The last part is the full path to the PDF file.


Run the batch file and see if it works. Once you have the batch file opening the PDF to the right place, then you can attach the batch file to a Foreign Object snippet in Realm Works. When you use the "play" button to "view" it, Realm Works will write the batch file to your Temp folder and run it, which should open the file for you.

Ohh... That is nifty! I am going to play around with that (going to use it for opening a spreadsheet - should be simpler).

Parody June 19th, 2015 03:24 PM

If the file would normally open properly by double-clicking on it in Explorer and you don't need to pass command line options it's a lot easier:

Code:

explorer "c:\full\path\to\file.doc"
You probably don't even need to say "explorer".

Bobifle June 19th, 2015 03:34 PM

Parody thanks for your insights.

I've tried the tag snippet and the batch files.

For the batch file, I'm not convinced because you need to create a specific snippet. It's too much work. Like you said I already have the material available (I have the printed book and the pdf) and I must balance the expense of creating my links and the benfits of clicking ont it.

Your tag snippet is a nice idea, but it kinda lack de link feature.

Right now I'm using a simple "custom ref" in GM direction for instance : "CRB p253" stands for Core Rule Book page 253 but like your tags, no link is available.

One question though :
Any benefits from using tags over simple text ?

Parody June 19th, 2015 03:55 PM

Quote:

Originally Posted by Bobifle (Post 211154)
For the batch file, I'm not convinced because you need to create a specific snippet. It's too much work. Like you said I already have the material available (I have the printed book and the pdf) and I must balance the expense of creating my links and the benfits of clicking ont it.

That's what happens when you're working around something not intended by the application.

Let's step back: what you're trying to do is reference the source text of an ability. If you really want to reference the entire text of something, bring the entire text into Realm Works. For example, create an Article named "The Ultimate discipline of death" that is set up like a Discipline description in your rulebook. Copy in the text from your PDF so it's all in the Article. Then your Realm Works links go to a complete description and you don't normally need to reference the PDF/physical book. I'd still put a source reference into the Topic/Article for those times when I want to reference the source material, though.


Quote:

Originally Posted by Bobifle (Post 211154)
Any benefits from using tags over simple text ?

You can pick a default, so in most cases I just needed to type in the page number(s). If it's not the default, you can pick the name from a list instead of typing. In a system where the book titles don't have accepted abbreviations, that's pretty useful. You can also easily find all of the Topics/Articles that came from a specific source using a Tag Filter.

Vargr June 20th, 2015 03:33 AM

@Parody:
Thank you for the suggestion.

---

I noticed that we have an option to insert a hyperlink (http:) in any snippet by right clicking the snippet.

I would like to suggest, that we get a file link as well, working in exactly the same manner - that would be extremely useful.

While Parody's solution work, it is not straightforward and a bit of a hassle to make.

Bobifle June 20th, 2015 07:36 AM

Quote:

Originally Posted by Vargr (Post 211181)
I noticed that we have an option to insert a hyperlink (http:) in any snippet by right clicking the snippet.

I would like to suggest, that we get a file link as well, working in exactly the same manner - that would be extremely useful.

That is a great suggestion. And would cost nothing to implement. You simply need to support the file:// protocol (security issue put aside, I know little about this)
.

Acenoid June 20th, 2015 04:20 PM

If RW would support Relative Paths (I would not know) it might be easier to link to other files on multiple machines


All times are GMT -8. The time now is 04:27 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.