Page 1 of 1

Is it possible to embed a pdf file in dsl?

PostPosted: Mon May 14, 2012 8:54 am
by hanyl05
As we know, jpg files can be embed with the following format,
[s]XX.jpg[/s]

Here I wonder
Is it possible to embed a pdf file, just as jpg or png files, that can be shown directly in goldendict, just as pdf files in IE ?
Any method to let it shown directly in GD by using CSS control or other methods?

Sincerely

Re: Is it possible to embed a pdf file in dsl?

PostPosted: Mon May 14, 2012 3:25 pm
by chulai
Short answer: No.

Long answer:

[s]XX.jpg[/s] is only for images, sounds and videos. Not to embed any kind of resource like PDFs or flash movies.

GoldenDict might be able to render embedded resources if the right browser plugin (http://en.wikipedia.org/wiki/NPAPI) is installed in the system. But DSL format does not have any option to render the html tag for this to happen (<embed> tag).

What you can do, is to add a link to the PDF file stored locally, so when you click on it, GD opens the doc in the application you have installed to handle PDF files. This is a trick, so it might work or not. Give it a try and let me know:

1) Search anything in that DSL dictionary.

2) Save the html (File > Save Article).

3) Open the web page in any text editor and search "gdfrom-".

4) Take note of the number. This is the dictionary's id. Example: gdfrom-49d5ebdb58d74708825e5f757739608c

5) Move your pdf to the same directory where the DSL file is located. Example: mypdf.pdf

6) Edit your DSL file and add a link to your PDF as follow:

Code: Select all
[url]bres://49d5ebdb58d74708825e5f757739608c/mypdf.pdf[/url]

7) Delete the dictionary inside GoldenDict (Edit > Dictionaries). Then added it again and perform a Rescan.

8) Search the term in the dictionary and verify the link works.

Re: Is it possible to embed a pdf file in dsl?

PostPosted: Tue May 15, 2012 3:40 pm
by hanyl05
Dear Chulai,

Many many thanks to your detailed reply with valuable information.
I have tried it according to your procedure, unfortunately, it seems that it doesn't works.

Thank you again for your kind reply.
Regards.

Re: Is it possible to embed a pdf file in dsl?

PostPosted: Tue May 15, 2012 3:48 pm
by chulai
Well, I tried myself and it worked. Maybe the dictionary id changed after reindexing?