pvginkel / PdfiumViewer

PDF viewer based on Google's PDFium.
Apache License 2.0
960 stars 418 forks source link

WinRT (Windows Store App) Support? #8

Closed peter0302 closed 9 years ago

peter0302 commented 9 years ago

Hey Pieter- While you're working on other updates to this great library, what are your thoughts about the possibility of this ever working on WinRT (Windows Store apps)? I know WinRT has a built-in PdfDocument API but it's very slow compared to Pdfium. We'd need to make a new build of Pdfium that played nice with WinRT but it shouldn't be too hard. (There could already be one for all I know, but I haven't found it).

Thanks!

Peter

pvginkel commented 9 years ago

I have no experience with WinRT. At the very least it would require an ARM build of Pdfium and a quick Google search gives me the idea that that may not be that easy. Besides that, from what I do know about WinRT is that it's difficult (if not impossible) to include native DLL's. If you have any background on this and could help me, or provide a pull request, I would be open to look at this.

peter0302 commented 9 years ago

Hey Pieter - yeah it would require a re-build of the pdfium.dll to remove or replace unsupported API calls and to add a static managed class to utilize the member functions. (WinRT apps can't use pinvoke or dllimport except in rare cases). (ARM vs. x86 vs. x64 wouldn't really matter unless there's assembly in the pdfium library which I assume not). Do you have a visual studio-friendly project for building pdfium? I can't for the life of me figure out what I'm supposed to do to create a project file. If you could post or send me that I could see how hard it would be to build it for WinRT. From your end of things I suspect little would change.

From: Pieter van Ginkelmailto:notifications@github.com Sent: ?Saturday?, ?February? ?14?, ?2015 ?1?:?32? ?PM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter N. Mooremailto:peter@mooreusa.net

I have no experience with WinRT. At the very least it would require an ARM build of Pdfium and a quick Google search gives me the idea that that may not be that easy. Besides that, from what I do know about WinRT is that it's difficult (if not impossible) to include native DLL's. If you have any background on this and could help me, or provide a pull request, I would be open to look at this.

Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-74388676.

pvginkel commented 9 years ago

I'm not really sure if I understand your question. PdfiumViewer is a normal C#project which you should just be able to open. However, the project really is just a simple wrapper around the Google Pdfium project which is native code (C++). I don't think this is going to work for WinRT.

peter0302 commented 9 years ago

I'm saying the native pdfium.dll would have to be recompiled (C++) to support WinRT. Do you have a Visual Studio project to build the native pdfium library?

It absolutely can work for WinRT. It's just a matter of compiling the pdfium.dll properly and making sure it doesn't use unsupported Windows API calls.

Your library could then support it with minimal modifications.

Sent from Windows Mail

From: Pieter van Ginkelmailto:notifications@github.com Sent: ?Thursday?, ?February? ?19?, ?2015 ?11?:?07? ?AM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter N. Mooremailto:peter@mooreusa.net

I'm not really sure if I understand your question. PdfiumViewer is a normal C#project which you should just be able to open. However, the project really is just a simple wrapper around the Google Pdfium project which is native code (C++). I don't think this is going to work for WinRT.

Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-75092444.

pvginkel commented 9 years ago

Ow gosh. That sounds cool. So, about compiling Pdfium. Basically the instructions are on the front page of the PdfiumViewer project. There is a link to a page by Google and I've added a few extra steps to get a dynamically linked DLL instead of a lib.

It does however take a bit of work to get all of this up and running and it's not really feasible to provide a project file. You need to use the build tools provided by Google.

If this doesn't work for you, maybe I can have a look. If you could explain the changes I need to make for the project to compile for WinRT I can see how far I can get.

peter0302 commented 9 years ago

Oh lord, I tried following those google directions and they're a mess. If you can get me a Visual Studio friendly project file, even for Win32, I can try to modify it for WinRT. But I don't have the time to waste learning 1970s era build tools. :)

Sent from Windows Mail

From: Pieter van Ginkelmailto:notifications@github.com Sent: ?Friday?, ?February? ?20?, ?2015 ?11?:?59? ?AM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter N. Mooremailto:peter@mooreusa.net

Ow gosh. That sounds cool. So, about compiling Pdfium. Basically the instructions are on the front page of the PdfiumViewer project. There is a link to a page by Google and I've added a few extra steps to get a dynamically linked DLL instead of a lib.

It does however take a bit of work to get all of this up and running and it's not really feasible to provide a project file. You need to use the build tools provided by Google.

If this doesn't work for you, maybe I can have a look. If you could explain the changes I need to make for the project to compile for WinRT I can see how far I can get.

Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-75287861.

pvginkel commented 9 years ago

I'm happy to help with this but I don't have time to do this soon. I'll give this a look the first chance I have.

peter0302 commented 9 years ago

Thanks and no problem! I know the feeling. :)

Like I said winrt has built in PDF rendering apis but pdfium is a lot faster.

On Feb 28, 2015 2:48 PM, Pieter van Ginkel notifications@github.com wrote:

I'm happy to help with this but I don't have time to do this soon. I'll give this a look the first chance I have.

Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-76545228.

leslawdietrich commented 9 years ago

I have a Visual Studio 2013 project which builds working dll and I am interested in Windows Store version. https://www.dropbox.com/s/h9p82ay4ckopxhw/pdfium-dll.7z?dl=0

peter0302 commented 9 years ago

Thanks! I'll check it out and see what can be done.

Sent from Windows Mail

From: Leslaw Dietrichmailto:notifications@github.com Sent: ?Wednesday?, ?March? ?4?, ?2015 ?3?:?13? ?PM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter N. Mooremailto:peter@mooreusa.net

I have a Visual Studio 2013 project which builds working dll and I am interested in Windows Store version. https://www.dropbox.com/s/h9p82ay4ckopxhw/pdfium-dll.7z?dl=0

Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-77248612.

peter0302 commented 9 years ago

Hey Leslaw - Thank you again for uploading that. I took a look and actually started trying to compile for WinRT. First off, I have to say it's a monstrosity of a library. The sheer number of source files is mindboggling. FORTUNATELY, the vast majority of them are pure standard C libraries, so compiling for WinRT is easy in those cases. But, there are also a lot of Windows API specific calls that would need to be changed to be Windows Store friendly.

The good news is that if one were content to forego the possibility of Windows Store certification, a WinRT app could link to the pdfium.dll without a problem. The app would be rejected from the Windows Store, but it could still be installed through sideloading on domain-joined machines or with a sideloading key which is a one time $100 cost. Is that something people are interested in?

If one were to try to convert the Win32 calls to make them Windows Store friendly and certifiable, the conversion and debugging would I think take several months of part time work. Maybe 2 weeks full time.

Those are my thoughts right now. If I make any substantial progress or have other ideas I'll let you know.

Peter

From: Leslaw Dietrichmailto:notifications@github.com Sent: ?Wednesday?, ?March? ?4?, ?2015 ?3?:?13? ?PM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter N. Mooremailto:peter@mooreusa.net

I have a Visual Studio 2013 project which builds working dll and I am interested in Windows Store version. https://www.dropbox.com/s/h9p82ay4ckopxhw/pdfium-dll.7z?dl=0

Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-77248612.

leslawdietrich commented 9 years ago

Well, I need pdfium for WinRT app. The built-in PDF viewer lacks some important features like search. With the enterprise customers I stick with WPF version. Anyway, thanks for your effort.

Leslaw

On Mon, Mar 16, 2015 at 6:07 PM, peter0302 notifications@github.com wrote:

Hey Leslaw - Thank you again for uploading that. I took a look and actually started trying to compile for WinRT. First off, I have to say it's a monstrosity of a library. The sheer number of source files is mindboggling. FORTUNATELY, the vast majority of them are pure standard C libraries, so compiling for WinRT is easy in those cases. But, there are also a lot of Windows API specific calls that would need to be changed to be Windows Store friendly.

The good news is that if one were content to forego the possibility of Windows Store certification, a WinRT app could link to the pdfium.dll without a problem. The app would be rejected from the Windows Store, but it could still be installed through sideloading on domain-joined machines or with a sideloading key which is a one time $100 cost. Is that something people are interested in?

If one were to try to convert the Win32 calls to make them Windows Store friendly and certifiable, the conversion and debugging would I think take several months of part time work. Maybe 2 weeks full time.

Those are my thoughts right now. If I make any substantial progress or have other ideas I'll let you know.

Peter

From: Leslaw Dietrichmailto:notifications@github.com Sent: ?Wednesday?, ?March? ?4?, ?2015 ?3?:?13? ?PM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter N. Mooremailto:peter@mooreusa.net

I have a Visual Studio 2013 project which builds working dll and I am interested in Windows Store version. https://www.dropbox.com/s/h9p82ay4ckopxhw/pdfium-dll.7z?dl=0

Reply to this email directly or view it on GitHub< https://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-77248612>.

— Reply to this email directly or view it on GitHub https://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-81813306.

pvginkel commented 9 years ago

I'm closing this issue for now because it does not seem feasible to do this with any reasonable effort. Thank you all for the research.

peter0302 commented 9 years ago

Understood and agreed. One day...

Sent from my Windows Phone


From: Pieter van Ginkelmailto:notifications@github.com Sent: ‎4/‎26/‎2015 4:19 AM To: pvginkel/PdfiumViewermailto:PdfiumViewer@noreply.github.com Cc: Peter Mooremailto:peter@mooreusa.net Subject: Re: [PdfiumViewer] WinRT (Windows Store App) Support? (#8)

I'm closing this issue for now because it does not seem feasible to do this with any reasonable effort. Thank you all for the research.

— Reply to this email directly or view it on GitHubhttps://github.com/pvginkel/PdfiumViewer/issues/8#issuecomment-96350760.