You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a pdf contains both https: and tel: links. Possibly even just tel: links, the parsing of the link fails in PDFViewerCanvas.
The code pasted below in the stack traces breaks and seems unnecessary. Let the url parse it and the platform handle it.
Steps to reproduce
open a pdf with tel: and mixed https links
attempt to open the tel: link
see it cause an error
Code sample
fixed code
//Just parse the url, be done with it and let the platform handle it!finalUri url =Uri.parse(_pdfTextWebLink!.url);
_showHyperLinkDialog(url);
markNeedsPaint();
break;
finalbool isMailID =RegExp(r'^.+@[a-zA-Z]+\.{1}[a-zA-Z]+(\.{0,1}[a-zA-Z]+)$')
.hasMatch(_pdfTextWebLink!.url);
//the assumption here is that this is a mail or https url, why's that?// why is any of this necessary?finalString scheme = isMailID
?!_pdfTextWebLink!.url.contains('mailto')
?'mailto':'': (!_pdfTextWebLink!.url.contains('https') &&!_pdfTextWebLink!.url.contains('http'))
?'https':'';
finalUri url =!_pdfTextWebLink!.url.contains(scheme)
? scheme.contains('mailto')
?Uri(scheme: scheme, path: _pdfTextWebLink!.url)
:Uri(scheme: scheme, host: _pdfTextWebLink!.url) //<--- this breaks, why is this even necessary.:Uri.parse(_pdfTextWebLink!.url);
_showHyperLinkDialog(url);
markNeedsPaint();
break;
On which target platforms have you observed this bug?
Android, iOS, Web, Web (Android browser), Web (iOS browser), Windows, macOS, Linux
Flutter Doctor output
N/A
The text was updated successfully, but these errors were encountered:
jonl-percsolutions-com
changed the title
Issue in parsing tel: urls from PDFs
[syncfusion_flutter_pdfviewer] Issue in parsing tel: urls from PDFs
Nov 20, 2024
We have resolved the issue with parsing PDF text web links that contains Telephone number link, and the fix for the same is available in our latest weekly release.
Bug description
When a pdf contains both
https:
andtel:
links. Possibly even justtel:
links, the parsing of the link fails in PDFViewerCanvas.The code pasted below in the stack traces breaks and seems unnecessary. Let the url parse it and the platform handle it.
Steps to reproduce
Code sample
fixed code
Screenshots or Video
N/a
Stack Traces
https://github.com/syncfusion/flutter-widgets/blob/master/packages/syncfusion_flutter_pdfviewer/lib/src/control/pdfviewer_canvas.dart
On which target platforms have you observed this bug?
Android, iOS, Web, Web (Android browser), Web (iOS browser), Windows, macOS, Linux
Flutter Doctor output
N/A
The text was updated successfully, but these errors were encountered: