Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PDF from embedded xulrunner in linux

3 views
Skip to first unread message

krithika

unread,
Sep 8, 2009, 5:09:10 AM9/8/09
to shyam....@gmail.com
I have embedded xulrunner1.9 in java and I do a print to PDF of my web
page contents in linux.

The problem I have is the links in the PDF output.

The following is my sample page
<html><body>
<p> ANCHOR 11 </p><a href="http://www.google.com">http://
www.google.com</a>
<p> ANCHOR 22 </p><a href="http://www.google.com">www.google.com</a>
<p> ANCHOR 33 </p><a href="http://www.google.com">www.yahoo.com</a>
<p> ANCHOR 44 </p><a href="http://www.google.com">search</a>
</body></html>


ANCHOR 11 and ANCHOR 22 is fine in the PDF generated.


ANCHOR 33 appears as a link but points to http://yahoo.com and not to
http://www.google.com

ANCHOR 44 Doesn't even appear as link.

My questions are

1. Has this been addressed in later versions of xulrunner.?
2. If not , can someone point out the gfx source of firefox which can
be modified to make this work.

Thanks in Advance,
krithi

Boris Zbarsky

unread,
Sep 8, 2009, 8:09:37 AM9/8/09
to
krithika wrote:
> ANCHOR 11 and ANCHOR 22 is fine in the PDF generated.
>
> ANCHOR 33 appears as a link but points to http://yahoo.com and not to
> http://www.google.com
>
> ANCHOR 44 Doesn't even appear as link.

That's presumably because we don't generate any semantics in PDF when
_printing_. Printing is purely a paint operation, with PDF as the
output device in your case.

Whatever is doing the linkification is outside our code.

> My questions are
>
> 1. Has this been addressed in later versions of xulrunner.?
> 2. If not , can someone point out the gfx source of firefox which can
> be modified to make this work.

There isn't any, really; you'd have to pass down semantic information,
not just graphics information all the way down to the pdf-creation
layer. That presumably involves changes to cairo, not just gfx.

-Boris

krithika

unread,
Sep 9, 2009, 12:11:41 AM9/9/09
to
On Sep 8, 5:09 pm, Boris Zbarsky <bzbar...@mit.edu> wrote:
> krithika wrote:
> > ANCHOR 11 and ANCHOR 22  is fine in the PDF generated.
>
> > ANCHOR 33 appears as a link but points tohttp://yahoo.comand not to

> >http://www.google.com
>
> > ANCHOR 44 Doesn't even appear as link.
>
> That's presumably because we don't generate any semantics in PDF when
> _printing_.  Printing is purely a paint operation, with PDF as the
> output device in your case.
>
> Whatever is doing the linkification is outside our code.
>
> > My questions are
>
> > 1. Has this been addressed in later versions of xulrunner.?
> > 2. If not , can someone point out the gfx source of firefox which can
> > be modified to make this work.
>
> There isn't any, really; you'd have to pass down semantic information,
> not just graphics information all the way down to the pdf-creation
> layer.  That presumably involves changes to cairo, not just gfx.
>
> -Boris

Yes I understand.Will it possible to give me some guidance on where
(exact cpp source code ) links get created so that I try to pass this
semantic info and create a link?.

Thanks for your quick and detailed response,
Krithi.

Boris Zbarsky

unread,
Sep 9, 2009, 9:36:02 AM9/9/09
to
krithika wrote:
> Yes I understand.Will it possible to give me some guidance on where
> (exact cpp source code ) links get created so that I try to pass this
> semantic info and create a link?.

nsHTMLAnchorElement.cpp is one place, but they could be all over. Any
node can be a link. Not sure what you mean by "created".

-Boris

krithika

unread,
Oct 13, 2009, 2:24:11 AM10/13/09
to

On further study I found that all text that start with "http: or
www" ( whether it is inside anchor or not) is treated as a link by
Acrobat Reader when PDF is opened.No special handling has been done
for anchors inside mozilla code or cairo code. As you pointed out it
is just the paint of print content.This cannot be fixed from within
mozilla code.

regards,
krithi

0 new messages