Bug in PDFKit

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in PDFKit

Victor Ivrii
I found that if using hyperref I include in URL non-ASCII characters like 

\href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}

then resulting pdf link works in Adobe Reader/Acrobat (and in kpdf) but not in Preview or TeXShop which do not launch WebBrowser to access this link. Definitely bug in Apple PDF ToolKit

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Herbert Schulz

On Apr 12, 2013, at 7:59 AM, Victor Ivrii <[hidden email]> wrote:

> I found that if using hyperref I include in URL non-ASCII characters like
>
> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}
>
> then resulting pdf link works in Adobe Reader/Acrobat (and in kpdf) but not in Preview or TeXShop which do not launch WebBrowser to access this link. Definitely bug in Apple PDF ToolKit

Howdy,

Could you supply a minimal but compilable example so we can see how you are including the cyrilic characters? Are you using UTF-8?

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Victor Ivrii



On Fri, Apr 12, 2013 at 9:05 AM, Herbert Schulz <[hidden email]> wrote:

On Apr 12, 2013, at 7:59 AM, Victor Ivrii <[hidden email]> wrote:

> I found that if using hyperref I include in URL non-ASCII characters like
>
> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}
>
> then resulting pdf link works in Adobe Reader/Acrobat (and in kpdf) but not in Preview or TeXShop which do not launch WebBrowser to access this link. Definitely bug in Apple PDF ToolKit

Howdy,

Could you supply a minimal but compilable example so we can see how you are including the cyrilic characters? Are you using UTF-8?

yes, I use UTF8 (in the source via TS preferences restarting TS each time and creating new files for reliability) but it affects neither Adobe Reader nor PDFKit based browsers (I tried several encodings to be sure).

\usepackage{hyperref}
\usepackage[unicode]{hyperref}
\usepackage[unicode,pdfencoding=auto]{hyperref}

again, it affects neither AR no Preview (or TS)

Also I tried 
\usepackage{cmap}
again, it affects neither AR no Preview (or TS)

Including

\usepackage[utf8]{inputenc}

returns an error

In the attached example second link works

\documentclass[12pt]{article}
%%%\usepackage[utf8]{inputenc}
%\usepackage{cmap}
%\usepackage{hyperref}
\usepackage[unicode,pdfencoding=auto]{hyperref}
\begin{document}
\href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}.

\end{document}


PS The second URL always works (used for comparison)

PPS Checked with Skim (does not work, no surprise—it is Apple PDFKit based as well), TeXWorks (works, it is poppler based)


Probably someone should file bug repport with Apple


Victor

========================
Victor Ivrii, Professor, Department of Mathematics, University of Toronto
http://www.math.toronto.edu/ivrii

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Herbert Schulz

On Apr 12, 2013, at 8:27 AM, Victor Ivrii <[hidden email]> wrote:

>
>
>
> On Fri, Apr 12, 2013 at 9:05 AM, Herbert Schulz <[hidden email]> wrote:
>
> On Apr 12, 2013, at 7:59 AM, Victor Ivrii <[hidden email]> wrote:
>
> > I found that if using hyperref I include in URL non-ASCII characters like
> >
> > \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}
> >
> > then resulting pdf link works in Adobe Reader/Acrobat (and in kpdf) but not in Preview or TeXShop which do not launch WebBrowser to access this link. Definitely bug in Apple PDF ToolKit
>
> Howdy,
>
> Could you supply a minimal but compilable example so we can see how you are including the cyrilic characters? Are you using UTF-8?
>
> yes, I use UTF8 (in the source via TS preferences restarting TS each time and creating new files for reliability) but it affects neither Adobe Reader nor PDFKit based browsers (I tried several encodings to be sure).
>
> \usepackage{hyperref}
> \usepackage[unicode]{hyperref}
> \usepackage[unicode,pdfencoding=auto]{hyperref}
>
> again, it affects neither AR no Preview (or TS)
>
> Also I tried
> \usepackage{cmap}
> again, it affects neither AR no Preview (or TS)
>
> Including
>
> \usepackage[utf8]{inputenc}
>
> returns an error
>
> In the attached example second link works
>
> \documentclass[12pt]{article}
> %%%\usepackage[utf8]{inputenc}
> %\usepackage{cmap}
> %\usepackage{hyperref}
> \usepackage[unicode,pdfencoding=auto]{hyperref}
> \begin{document}
> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}.
>
> \href{http://ru.wikipedia.org/wiki/}{Russian wikipedia}.
> \end{document}
>
>
> PS The second URL always works (used for comparison)
>
> PPS Checked with Skim (does not work, no surprise—it is Apple PDFKit based as well), TeXWorks (works, it is poppler based)
>
>
> Probably someone should file bug repport with Apple
>
>
> Victor
Howdy,

I can't compile using pdflatex and \usepackage[utf8]{inputenc} but \usepackage[utf8x]{inputenc} seems to allow compilation. I believe the [utf8] is very limited and doesn't translate Cyrillic
Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Herbert Schulz

On Apr 12, 2013, at 8:58 AM, Herbert Schulz <[hidden email]> wrote:

>
> On Apr 12, 2013, at 8:27 AM, Victor Ivrii <[hidden email]> wrote:
>
>>
>>
>>
>> On Fri, Apr 12, 2013 at 9:05 AM, Herbert Schulz <[hidden email]> wrote:
>>
>> On Apr 12, 2013, at 7:59 AM, Victor Ivrii <[hidden email]> wrote:
>>
>>> I found that if using hyperref I include in URL non-ASCII characters like
>>>
>>> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}
>>>
>>> then resulting pdf link works in Adobe Reader/Acrobat (and in kpdf) but not in Preview or TeXShop which do not launch WebBrowser to access this link. Definitely bug in Apple PDF ToolKit
>>
>> Howdy,
>>
>> Could you supply a minimal but compilable example so we can see how you are including the cyrilic characters? Are you using UTF-8?
>>
>> yes, I use UTF8 (in the source via TS preferences restarting TS each time and creating new files for reliability) but it affects neither Adobe Reader nor PDFKit based browsers (I tried several encodings to be sure).
>>
>> \usepackage{hyperref}
>> \usepackage[unicode]{hyperref}
>> \usepackage[unicode,pdfencoding=auto]{hyperref}
>>
>> again, it affects neither AR no Preview (or TS)
>>
>> Also I tried
>> \usepackage{cmap}
>> again, it affects neither AR no Preview (or TS)
>>
>> Including
>>
>> \usepackage[utf8]{inputenc}
>>
>> returns an error
>>
>> In the attached example second link works
>>
>> \documentclass[12pt]{article}
>> %%%\usepackage[utf8]{inputenc}
>> %\usepackage{cmap}
>> %\usepackage{hyperref}
>> \usepackage[unicode,pdfencoding=auto]{hyperref}
>> \begin{document}
>> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}.
>>
>> \href{http://ru.wikipedia.org/wiki/}{Russian wikipedia}.
>> \end{document}
>>
>>
>> PS The second URL always works (used for comparison)
>>
>> PPS Checked with Skim (does not work, no surprise—it is Apple PDFKit based as well), TeXWorks (works, it is poppler based)
>>
>>
>> Probably someone should file bug repport with Apple
>>
>>
>> Victor
>
> Howdy,
>
> I can't compile using pdflatex and \usepackage[utf8]{inputenc} but \usepackage[utf8x]{inputenc} seems to allow compilation. I believe the [utf8] is very limited and doesn't translate Cyrillic
> Good Luck,
>
> Herb Schulz
> (herbs at wideopenwest dot com)
Howdy,

Sorry, incomplete thought when I sent...

... while [utf8x] does a better job.

In any case one usually gets an information note when hovering over a hyperlink and I don't get one with the first version but do get it with the second version, at least with a PDFKit version; i.e., I'm seeing what you're seeing.

Why don't you report the bug to Apple and include your pdf file?

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Herbert Schulz

On Apr 12, 2013, at 9:06 AM, Herbert Schulz <[hidden email]> wrote:

>
> On Apr 12, 2013, at 8:58 AM, Herbert Schulz <[hidden email]> wrote:
>
>>
>> On Apr 12, 2013, at 8:27 AM, Victor Ivrii <[hidden email]> wrote:
>>
>>>
>>>
>>>
>>> On Fri, Apr 12, 2013 at 9:05 AM, Herbert Schulz <[hidden email]> wrote:
>>>
>>> On Apr 12, 2013, at 7:59 AM, Victor Ivrii <[hidden email]> wrote:
>>>
>>>> I found that if using hyperref I include in URL non-ASCII characters like
>>>>
>>>> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}
>>>>
>>>> then resulting pdf link works in Adobe Reader/Acrobat (and in kpdf) but not in Preview or TeXShop which do not launch WebBrowser to access this link. Definitely bug in Apple PDF ToolKit
>>>
>>> Howdy,
>>>
>>> Could you supply a minimal but compilable example so we can see how you are including the cyrilic characters? Are you using UTF-8?
>>>
>>> yes, I use UTF8 (in the source via TS preferences restarting TS each time and creating new files for reliability) but it affects neither Adobe Reader nor PDFKit based browsers (I tried several encodings to be sure).
>>>
>>> \usepackage{hyperref}
>>> \usepackage[unicode]{hyperref}
>>> \usepackage[unicode,pdfencoding=auto]{hyperref}
>>>
>>> again, it affects neither AR no Preview (or TS)
>>>
>>> Also I tried
>>> \usepackage{cmap}
>>> again, it affects neither AR no Preview (or TS)
>>>
>>> Including
>>>
>>> \usepackage[utf8]{inputenc}
>>>
>>> returns an error
>>>
>>> In the attached example second link works
>>>
>>> \documentclass[12pt]{article}
>>> %%%\usepackage[utf8]{inputenc}
>>> %\usepackage{cmap}
>>> %\usepackage{hyperref}
>>> \usepackage[unicode,pdfencoding=auto]{hyperref}
>>> \begin{document}
>>> \href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}.
>>>
>>> \href{http://ru.wikipedia.org/wiki/}{Russian wikipedia}.
>>> \end{document}
>>>
>>>
>>> PS The second URL always works (used for comparison)
>>>
>>> PPS Checked with Skim (does not work, no surprise—it is Apple PDFKit based as well), TeXWorks (works, it is poppler based)
>>>
>>>
>>> Probably someone should file bug repport with Apple
>>>
>>>
>>> Victor
>>
>> Howdy,
>>
>> I can't compile using pdflatex and \usepackage[utf8]{inputenc} but \usepackage[utf8x]{inputenc} seems to allow compilation. I believe the [utf8] is very limited and doesn't translate Cyrillic
>> Good Luck,
>>
>> Herb Schulz
>> (herbs at wideopenwest dot com)
>
> Howdy,
>
> Sorry, incomplete thought when I sent...
>
> ... while [utf8x] does a better job.
>
> In any case one usually gets an information note when hovering over a hyperlink and I don't get one with the first version but do get it with the second version, at least with a PDFKit version; i.e., I'm seeing what you're seeing.
>
> Why don't you report the bug to Apple and include your pdf file?
>
> Good Luck,
>
> Herb Schulz
> (herbs at wideopenwest dot com)
Howdy,

And once again... sending before I'm finished...

Report bugs at <https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/wa/signIn> where you'll have to enter your Apple ID.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Peter Dyballa
In reply to this post by Victor Ivrii

Am 12.04.2013 um 14:59 schrieb Victor Ivrii:

> I found that if using hyperref I include in URL non-ASCII characters like

You've made a mistake here.

Uniform Resource Locators need to be either in 7-bit U.S. ASCII or in case on an “unsafe” encoding you would need to transform it according to RFC 1738. In the end the cyrillic characters would be encoded as %<HEX byte>%<HEX byte>. “Unsafe” means here ambiguous meaning of the code points because more than one character encoding can be applied. Punycode (RFC 3492) is another option to encode an "international" URL.

I think this restriction is still true in 2013.

There is also RFC 3987. It allows to use Unicode/ISO 10646 characters. Is it mandatory for PDF-1.4 or PDF-1.5?

--
Greetings

  Pete

There are three types of people in this world: those who can count, and those who cannot.


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Victor Ivrii
In reply to this post by Herbert Schulz



On Fri, Apr 12, 2013 at 9:58 AM, Herbert Schulz <[hidden email]> wrote:



Howdy,

I can't compile using pdflatex and \usepackage[utf8]{inputenc} but \usepackage[utf8x]{inputenc} seems to allow compilation. I believe the [utf8] is very limited and doesn't translate Cyrillic


Actually combination
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}

works well to translate cyrillic (see below) and without \usepackage[T2A]{fontenc} utf8x does not work on the example 1 attached.


However the main question is a bug in PDF toolkit (example 2 does not launch web browser)




%% example 1%%%
\documentclass[12pt]{article}
\usepackage{cmap}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}



%\usepackage{hyperref}
\usepackage[unicode,pdfencoding=auto]{hyperref}
\begin{document}
Физико-математическая школа им. М. А. Лаврентьева при НГУ

\end{document}


%% example 2%%%
\documentclass[12pt]{article}
\usepackage{cmap}
\usepackage[utf8x]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[unicode,pdfencoding=auto]{hyperref}

\begin{document}
\href{http://ru.wikipedia.org/wiki/Физико-математическая_школа_им._М._А._Лаврентьева_при_НГУ}{Physical Mathematical School at Novosibirsk State University}.

\href{<a href="http://ru.wikipedia.org/wiki/}{Russian">http://ru.wikipedia.org/wiki/}{Russian wikipedia}.
\end{document}


Victor
--
========================
Victor Ivrii, Professor, Department of Mathematics, University of Toronto
<a href="http://www.math.toronto.edu/ivrii%%">http://www.math.toronto.edu/ivrii%% example 1%%%

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: Bug in PDFKit

Victor Ivrii
In reply to this post by Peter Dyballa
Somehow several messages came with 3 days delay

On Fri, Apr 12, 2013 at 10:32 AM, Peter Dyballa <[hidden email]> wrote:

Am 12.04.2013 um 14:59 schrieb Victor Ivrii:

> I found that if using hyperref I include in URL non-ASCII characters like

You've made a mistake here.

Uniform Resource Locators need to be either in 7-bit U.S. ASCII or in case on an “unsafe” encoding you would need to transform it according to RFC 1738. In the end the cyrillic characters would be encoded as %<HEX byte>%<HEX byte>. “Unsafe” means here ambiguous meaning of the code points because more than one character encoding can be applied. Punycode (RFC 3492) is another option to encode an "international" URL.

I think this restriction is still true in 2013.



I used urlencode on cyrillic part and produced pdf contains link recognized by Preview.

Unfortunately tooltip in Preview shows Chinese characters -- exactly as if I insert link with Acrobat (even if I tried to load fontenc and inputenc and camp) while tooltip in Adobe Reader shows Cyrillic characters.

I am not sure anyway why non-PDFtoolkit based browsers (kpdf, AR, texworks) have no grudges against plain vanilla URLs while Preview and other PDFKit based browsers have problems.


Victor

On Fri, Apr 12, 2013 at 10:11 AM, Herbert Schulz <[hidden email]> wrote:

> Report bugs at <https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/wa/signIn> where you'll have to enter your Apple ID.

 I a couple of days of testing I will  submit bug report to Apple


Victor 



-

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex