New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

Is it possible to embed a pdf file in dsl?

General discussion

Is it possible to embed a pdf file in dsl?

Postby hanyl05 » Mon May 14, 2012 8:54 am

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
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

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

Postby chulai » Mon May 14, 2012 3:25 pm

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.
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

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

Postby hanyl05 » Tue May 15, 2012 3:40 pm

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.
hanyl05
 
Posts: 125
Joined: Mon Dec 05, 2011 1:00 pm

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

Postby chulai » Tue May 15, 2012 3:48 pm

Well, I tried myself and it worked. Maybe the dictionary id changed after reindexing?
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm


Return to General

Who is online

Users browsing this forum: No registered users and 35 guests