473,511 Members | 17,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Marking PDF links

I seem to recall reading about a feature so that you could apply
different styles to different kinds of link.

e.g. local and offsite or to automatically put a logo beside some
domain links.

I would like to add an icon to pdf links.

I'm after something of the form a:link("*.pdf) { properties ... }

Does anyone know the names of the keywords or the syntax, or if this
is even possible?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 22 '06 #1
15 2111
Roedy Green wrote:
I seem to recall reading about a feature so that you could apply
different styles to different kinds of link.

e.g. local and offsite or to automatically put a logo beside some
domain links.


http://www.w3.org/TR/css3-selectors/...ute-substrings

Note that this is a working draft, not a final spec. There are some
experimental implementions in the wild, but everything is still subject to
change.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 22 '06 #2
David Dorward <do*****@yahoo.com> wrote:
Roedy Green wrote:
I seem to recall reading about a feature so that you could apply
different styles to different kinds of link.

e.g. local and offsite or to automatically put a logo beside some
domain links.


http://www.w3.org/TR/css3-selectors/...ute-substrings

Note that this is a working draft, not a final spec. There are some
experimental implementions in the wild, but everything is still subject to
change.


If you use type="application/pdf" for links to PDF resources, you could use
attribute selectors in CSS for them.

That would be an exercise in futility, though. It is useful, and often
essential, to indicate PDF links as PDF links, since following such a link
may confuse the user, cause a considerable delay, result in a blank window,
crash the browser, give the user data that he cannot use because PDF is so
inaccessible a format (despite all the Adobe marketese), or simply fail to do
anything useful due to lack of any PDF viewer on the user's system. However,
many of these points are equally relevant or more relevant in browsing
situations where style sheets are not in use (or the intended visual
indication fails miserably, e.g. because it relies on colors and the user is
blind).

Thus, the best approach is something like
"There are more details on this in the (PDF) document Foo Bar."

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jan 22 '06 #3
On Sun, 22 Jan 2006 11:33:26 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote, quoted or indirectly quoted someone who
said :
That would be an exercise in futility, though. It is useful, and often
essential, to indicate PDF links as PDF links, since following such a link
may confuse the user, cause a considerable delay, result in a blank window,
crash the browser, give the user data that he cannot use because PDF is so
inaccessible a format (despite all the Adobe marketese), or simply fail to do
anything useful due to lack of any PDF viewer on the user's system.


However, if others have elected to provide their papers only in PDF
format, you have no choice if you want to link to them. The best I
figured I could do is warn people a link was to a PDF document.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 22 '06 #4
Roedy Green wrote:
I seem to recall reading about a feature so that you could apply
different styles to different kinds of link.

I would like to add an icon to pdf links.

CSS:
a .pdf {
background: #fff url(pdf-image-path) left center no-repeat;
padding-left: width-of-image-px;
}

HTML:
<a href="http://..." class="pdf">whatever</a>

The image would have to be fairly small (< 16px height) to not interfere
with other inline text. Which would likely make the PDF logo unrecognizable.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jan 22 '06 #5
On Sun, 22 Jan 2006 11:33:26 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote, quoted or indirectly quoted someone who
said :
That would be an exercise in futility, though. It is useful, and often
essential, to indicate PDF links as PDF links, since following such a link
may confuse the user, cause a considerable delay, result in a blank window,
crash the browser, give the user data that he cannot use because PDF is so
inaccessible a format (despite all the Adobe marketese), or simply fail to do
anything useful due to lack of any PDF viewer on the user's system. However,
many of these points are equally relevant or more relevant in browsing
situations where style sheets are not in use (or the intended visual
indication fails miserably, e.g. because it relies on colors and the user is
blind).

what I have done in the meantime looks like this:

<a href="http://www.cs.brown.edu/courses/cs161/papers/j-nio-ltr.pdf"
class="pdf">nio tutorial in PDF</a>
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 22 '06 #6
Roedy Green wrote:
On Sun, 22 Jan 2006 11:33:26 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote, quoted or indirectly quoted someone who
said :

That would be an exercise in futility, though.
(snip)

what I have done in the meantime looks like this:

<a href="http://www.cs.brown.edu/courses/cs161/papers/j-nio-ltr.pdf"
class="pdf">nio tutorial in PDF</a>


Roedy,

Actually, the SOURCE looks like this. Since the newsgroup doesn't have
access to your stylesheet, we have no idea what the RESULT looks like.

In any case, IMO:
- Yes, you should identify links to PDFs (or any filetype other than
(X)HTML.
- You should also show its size, since many such external resources
are huge. At the least, this will allow the user to know in advance
that linking to this resource might be a good time to take a bathroom
break...

(Yes, in this case DeveloperWorks could update the document and change
its size, but you'd probably still be in the ballpark.)

Chris Beall
Jan 22 '06 #7
In article <87********************************@4ax.com>,
Roedy Green <my******************************@munged.invalid > wrote:
I seem to recall reading about a feature so that you could apply
different styles to different kinds of link.

e.g. local and offsite or to automatically put a logo beside some
domain links.

I would like to add an icon to pdf links.


Have a look at
<http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
Jan 23 '06 #8
On Sun, 22 Jan 2006 21:11:40 GMT, Chris Beall
<Ch*********@prodigy.net> wrote, quoted or indirectly quoted someone
who said :
(Yes, in this case DeveloperWorks could update the document and change
its size, but you'd probably still be in the ballpark.)


I generate much of my code with HTML static macros expanded prior to
upload. So if I really wanted I could check the file sizes. I do to
some extent for local files.

see http://mindprod.com/jgloss/htmlstaticmacros.html

the style looks like this:

..pdf, a.pdf:link, a.pdf:visited, a.pdf:active
/* download a pdf file */{
background: url(images/pdf.png) transparent no-repeat scroll
right;
/* top right bottom left */
padding: 3px 35px 3px 2px;
}

The problem was not the style. It was trying to automatically hook it
up to the .pdf extension.

You can see it in action at http://mindprod.com/jgloss/nio.html
near the bottom.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 23 '06 #9
On Mon, 23 Jan 2006 01:01:48 +0100, Sander Tekelenburg
<us**@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
Have a look at
<http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>


I'm puzzled how you could select by MIME type. You don't normally find
that out the MIME type until you probe the server. But you don't
normally do that until you click a link.

Does the browser probe all the links on page??? Surely not. Or does it
make some guess at the MIME type from the extension.? That guess is
probably wrong as every server uses a different table of extensions to
MIME.

Severs would have to divulge their lists.
..
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 23 '06 #10
> On Mon, 23 Jan 2006 01:01:48 +0100, Sander Tekelenburg
<us**@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
Have a look at
<http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>

Roedy Green wrote: I'm puzzled how you could select by MIME type. You don't normally find
that out the MIME type until you probe the server.


Right, but there is the type attribute which contains a _hint_ about the
MIME type. That's what is used here.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jan 23 '06 #11
On Mon, 23 Jan 2006 10:59:57 +0100, Johannes Koch
<ko**@w3development.de> wrote, quoted or indirectly quoted someone who
said :

Right, but there is the type attribute which contains a _hint_ about the
MIME type. That's what is used here.


where does a browser find out the type attribute of a link?
all it has is the extension, right?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 23 '06 #12
In article <jh********************************@4ax.com>,
Roedy Green <my******************************@munged.invalid > wrote:
On Mon, 23 Jan 2006 10:59:57 +0100, Johannes Koch
<ko**@w3development.de> wrote, quoted or indirectly quoted someone who
said :
Right, but there is the type attribute which contains a _hint_ about the
MIME type. That's what is used here.
where does a browser find out the type attribute of a link?


Why, in the HTML obviously. Just like with any other elements and
attributes. Did you read the page I referred you to? Did you look at its
HTML?
all it has is the extension, right?


If that's all its been given, yes. But nothing is stopping you from
providing it with a proper MIME type, through the type attribute.

I thought this was all made pretty obvious at
<http://www.euronet.nl/~tekelenb/WWW/userfriendlierhyperlinks/>.

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
Jan 23 '06 #13
On Mon, 23 Jan 2006 22:46:29 +0100, Sander Tekelenburg
<us**@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
where does a browser find out the type attribute of a link?


Why, in the HTML obviously. Just like with any other elements and
attributes. Did you read the page I referred you to? Did you look at its
HTML?

No, not "obviously". That scheme has no automation unless there is
somewhere locally a table of extensions. You might as well tag with
ordinary classes. You still have to manually assign the types in the
markup. It is just a variant of manual tagging with classes. . MIME
types normally come from the server. This is a mis-use of the term.
Further the author of the page did not show markup, just styles, other
than via view source. Further his examples did not work, so it was not
obvious he even did anything in the markup.

Ideally he would have given a concrete example in addition to the BNF
of both a style and markup. When you talk about the "type" of
something you could be talking in the ordinary English sense, about
the extension, about a type derived, or about a literal TYPE tag. It
is obvious only once you are familiar with how it works.

I have been adding classes to my website links and discovered that I
don't really want to select ALL links by extension. There are many I
want to exclude, so manually inserting classes on the links is
probably the best you can do.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Jan 24 '06 #14
Deciding to do something for the good of humanity, Roedy Green
<my******************************@munged.invalid > declared in
comp.infosystems.www.authoring.stylesheets:
On Mon, 23 Jan 2006 22:46:29 +0100, Sander Tekelenburg
<us**@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
where does a browser find out the type attribute of a link?


Why, in the HTML obviously.


No, not "obviously".


Why not? Where else would you look for attributes in an HTML document,
other than the HTML?

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Jan 24 '06 #15
In article <th********************************@4ax.com>,
Roedy Green <my******************************@munged.invalid > wrote:
On Mon, 23 Jan 2006 22:46:29 +0100, Sander Tekelenburg
<us**@domain.invalid> wrote, quoted or indirectly quoted someone who
said :
where does a browser find out the type attribute of a link?
Why, in the HTML obviously. Just like with any other elements and
attributes. Did you read the page I referred you to? Did you look at its
HTML?

No, not "obviously". That scheme has no automation


{confused} What sort of "automation" are you looking for?
unless there is
somewhere locally a table of extensions.
"extensions"? (Do you mean file name extensions? What is the relevance
of that?)
You might as well tag with
ordinary classes.
Yes, you can, but if you're going to add classes, you might as well add
type attributes. Type attributes actually have meaning on the Web, plus
this way you avoid 'CLASS-soup'. Personally I prefer to add as little
DIVs, SPANs, classes and IDs as is possible - keep the HTML clean and
make use of CSS selectors to target things.
You still have to manually assign the types in the
markup.
Less so than you have to manually add classes. My argument for using the
type attribute instead is not only that it adds more value than just
being a CSS selector, but also that automated Web publishing systems
could easily insert type attributes automagically - something they can't
do with classes. Thus using the type attribute provides a much better
opportunity for an automated authoring approach then using classes.

[...]
MIME types normally come from the server.
MIME types are MIME types. Servers serve them through Content-Type
headers and before they do, they look them up through whatever mechanism
the server's local environment provides for that (which does not have to
be through file name extensions - for instance, on a Mac a server might
use the system's type/creator database).

[...]
Further the author of the page did not show markup, just styles, other
than via view source.
What's too hard about viewing the source?
Further his examples did not work
"work" in the environment of the Web is extremely tool-dependant. If the
tool you used didn't 'work', then maybe that tool doesn't work.

The bottom of that page lists some browsers that *do* support this. Did
you see that? Didn't it make you think that perhaps the browser you were
using might not be working?
, so it was not
obvious he even did anything in the markup.
The page explains how to "target the type attribute", big header,
through CSS and shows two examples. How then can it not be obvious that
the HTML contains type attributes?
Ideally he would have given a concrete example in addition to the BNF
of both a style and markup. When you talk about the "type" of
something you could be talking in the ordinary English sense, about
the extension, about a type derived, or about a literal TYPE tag.


Indeed. Therefore, at that page I don't just vaguely speak of "type",
but of "type attributes" - each and every time.

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
Jan 25 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1243
by: Mad_Cat_SCP | last post by:
I did a very basic calendar in php, and know I want to mark some days. For example: -exam days, semesters, etc. What is the best way to do this? I want to click a link, button, checkbox,etc and...
3
1915
by: Spartanicus | last post by:
How to get help from this group, and how to construct a minimised test case: http://www.spartanicus.utvinternet.ie/help_us_help_you.htm -- Spartanicus
3
1964
by: Damien | last post by:
Okay, most peoples answer to this may be "Gaaah. Why would you do this?", or the like, but here's the question anyway: Are there any stability issues if I mark one of my user tables as a system...
17
12199
by: Mark Tranchant | last post by:
On some of my pages, for example: http://tranchant.plus.com/guitar/chord-tutorial/music-theory ....I refer to musical note names a lot in the text, such as A, F# and Eb. Whilst cycling in to...
4
4497
by: sicapitan | last post by:
I have this code snippet: updateProps snippet: if (mycheckbox.checked == '1') ? $('mycheckbox').checked = true : $('mycheckbox').checked = false; content = $('mydiv').innerHTML;
9
23228
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
How do I mark a method or class in my library as deprecated, so that when it is used by some other application, the compiler will issue a warning?
0
2684
by: Nokao | last post by:
I'm having a lot of severe errors in my db2diag.log, (DB2 v9.1.0.0). Googling I don't fin any information :( What can I do? I attach the first reports...: 2007-11-19-17.50.26.379948+060...
1
525
by: Hvid Hat | last post by:
Hello How should I go about marking certain words in a text? I've got a list of words: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="Mark.xsl"?> <Words>...
16
4022
by: Pie Squared | last post by:
I'm not completely sure that this is the right place to ask, but I'm doing it in C, so I'm asking, but if I'm wrong, then please don't hesitate to correct me and tell me where to post this. What...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.