MishaUliutin / MuPDF.WinRT

Windows 8 and Windows Phone 8 WinRT component - MuPDF wrapper
GNU General Public License v3.0
26 stars 24 forks source link

MUPdf windows phone 8 #18

Closed gauravlohanilohani closed 10 years ago

gauravlohanilohani commented 10 years ago

I have getting the error :- Requested Windows Runtime type 'MuPDFWinRT.Document' is not registered.

Code is. using (var document = //getting error here Document.Create(WindowsRuntimeBufferExtensions.AsBuffer(GetStreamData()), // - file GetDocumentType(), // type 160 + scaleFactor)) // - dpi { //here my code }

plz solve this..

MishaUliutin commented 10 years ago

Did you added refernce to MuPDF?

Best Regards, Misha Uliutin

gauravlohanilohani commented 10 years ago

Yes i have added the MuPDFWinRT in my project.

MishaUliutin commented 10 years ago

hmm, could you check please that you use right version of MuPDF for right platform? (ARM for ARM, x86 for x86)? You could find example there - https://bitbucket.org/mishauliutin/pdf-reader-for-wp8-public

Best Regards, Misha Uliutin

gauravlohanilohani commented 10 years ago

i used all platform version but still the problem is occurred.

i attached the error screenshots. wp_ss_20140131_0001 1

Thanks for your support...

MishaUliutin commented 10 years ago

hmm, Could you share your code by github/bitbucket/GoogleCode?

Best Regards, Misha Uliutin

gauravlohanilohani commented 10 years ago

shere my code with you plz check. i got the error on Document.creat() point. here is my code..

private void GetPageDataAndDraw(int reader, bool isDocumentMoving, int scaleFactor = 0) { using (var document = Document.Create(WindowsRuntimeBufferExtensions.AsBuffer(GetStreamData()), // - file GetDocumentType(), // type 160 + scaleFactor)) // - dpi { WriteableBitmap image = null; int sizeX = 0; int sizeY = 0;

                MuPDFWinRT.Point size = document.GetPageSize(0);
                sizeX = size.X;
                sizeY = size.Y;

                UISynchronizationContext.Instance.InvokeAndBlockUntilCompletion(delegate
                {
                    image = new WriteableBitmap(size.X, size.Y);
                });

                pixels = image.Pixels;
                try
                {
                    if (Book.BookExtension == DataService.Objects.Enums.BookExtension.PDF)
                        document.DrawPage(0, pixels, 0, 0, sizeX, sizeY, false);
                    else if (Book.BookExtension == DataService.Objects.Enums.BookExtension.CBZ)
                        document.DrawPage((_currentPage - 1), pixels, 0, 0, sizeX, sizeY, false);
                }
                catch
                {
                    //LoadPageFromIsolated(reader);
                }

                UISynchronizationContext.Instance.InvokeAndBlockUntilCompletion(delegate
                {
                    data = null;
                    //task = null;
                    //GC.Collect();
                    try
                    {
                        image.Invalidate();
                        BindPage(reader, isDocumentMoving, image);
                    }
                    catch
                    {

                    }
                });

                document.Dispose();
            }
        //}
        //catch { }
    }
gauravlohanilohani commented 10 years ago

hey plz help me for my question?

MishaUliutin commented 10 years ago

Hi, sorry was in vocation, so, could you please check that .winmd file and the .dll file generated from the WinRT Component have THE SAME NAME (e.g: MuPDFWinRT.dll and MuPDFWinRT.winmd).

Then:

Add the .winmd medata file as a reference in your project. Check that the .winmd / dll files are in the same folder to be correctly loaded.

gauravlohanilohani commented 10 years ago

hi, i have check the name they are same but when i add refrence of MuPDFWinRT.winmd and run the project , then i see my Bin\ARM\Debug folder there is no .dll or .pdb file of MuPDFWinRT, so what can i do? need Help

MishaUliutin commented 10 years ago

does MuPDFWinRT.dll locate in the same folder as MuPDFWinRT.winmd(which you reference)?

gauravlohanilohani commented 10 years ago

yes

MishaUliutin commented 10 years ago

Could you create new simple project with MuPDFWinRT and share it source code?

gauravlohanilohani commented 10 years ago

hi when i create a new project both the files are correctly loaded in arm\debug folder, but in my current project they not loaded .. please suggest .

gauravlohanilohani commented 10 years ago

hi its solved now thanks for Your support. in my project 2 sub project in one of that subproject i used mupdf and build the sub project thats why the dll are not loaded, but when we build the main project the mupdfwinrt.dll correctly loded.

81093507689 commented 10 years ago

Hello sir i have download your "mishauliutin-pdf-reader-for-wp8-public" project When i m open any pdf file from SDCARD List then error message is and not open any pdf file Can not open file - testPath1.:( OK button please Solve my problem I am waiting Your replay thanks

81093507689 commented 10 years ago

Hello sir i have download your "mishauliutin-pdf-reader-for-wp8-public" project When i m open any pdf file from SDCARD List then error message is and not open any pdf file Can not open file - testPath1.:( OK button please Solve my problem I am waiting Your replay thanks

81093507689 commented 10 years ago

hello , I have a _navigation problem when i am try to open this function how to solve this problem _navigation is null public void OpenFile(IFileInfo fileInfo) {

        if (IsLoading)
            return;

        _navigationService.UriFor<FileViewerPageViewModel>().WithParam(x => x.CurrentFileId, fileInfo.Id).Navigate();
    }