i tried the PDF Viewer Preview and understood the working principle and implemented it as mentioned in your demo.
Unfortunately there is an error with the System.Drawing.Common.dll.
You use this reference for creating a bitmap of the selected page out of the in-memory-stored pdf-bytes. During creating this bitmap i encountered this error and wanted to ask you if you can reproduce that error or what may caused that thing?
I use this references...
Please note the comments below… everything works until it goes to the point where the image-conversion starts...
RTRamya Thirugnanam Syncfusion Team January 7, 2019 07:29 AM UTC
Thanks for contacting Syncfusion support.
We are unable to reproduce the reported issue with mentioned scenario. However, we suspect that the issue may be occurred when the value of the zoomFactor is negative in the jsonObject. We have provided the sample and JsonObject image (screenshot to pdf) to represent this. Please refer to the sample as below.
The jsonObject must contain variables as shown in the below screenshot to render the PDF document.
Could you please validate the provided sample with reported issue the above sample and provide us with the modified sample or video to replicate the reported issue and confirm us whether you are sending your own JSON data. if so please provide us JSON data regarding it.
FSFlorian SchwendtnerJanuary 7, 2019 05:38 PM UTC
thanks for your reply!
I brought it alive now... and yes, it was the zoomFactor.
Now another thing: if I load a pdf in the viewer and the viewer is too small to display it at a zoomValue of 100 and tries to open it with a zoomValue of around 0.60 the page is not getting displayed properly. I came across this issue with the following code but you need to help me how to reset the zoomValue programmatically until the document is loaded properly.
Ended up with this solution but there has to be a propper call to get the zoomValue back to 100 until document is properly loaded:
RTRamya Thirugnanam Syncfusion Team January 8, 2019 09:42 AM UTC
Download the latest nuget package from the below link,
The issue will be resolved with the updated script files and there is no need to use the code changes (without) which was shared in your last update.
FSFlorian SchwendtnerJanuary 9, 2019 04:29 PM UTC
i did as you mentioned and updated everything to the latest version.
The behaviour is:
- by issuing the PdfViewer.Load() method the method gets called but the processing will not finish - the "loaded" event never gets triggered
- the .Load() method changes the document zoom to 0.60 (60%) due to the small size of the viewer and fires the event "documentzoomchange"
- if i manually change the .magnification.zoomfactor back to 1 - and only then - the document gets loaded successfully...
I attached a video where you can see clearly that after the initial loading and changing the zoomlevel manually to 100% everything works fine until I zoom out and try to load the next pages of the document. the pages are only getting loaded successfully if the zoomlevel is 1/100%. after initially loading with 100% zoom out and in works well - but if the initial page load is not made with 100% the pages will not get rendered.
I hope you can reproduce this with a large document with about 20+ pages where the couple first are maybe loaded at 100% and if you zoom out and scroll then down to the next pages they are not getting loaded successfully... until you zoom out to 100% :-)
Could you please try the provided sample and modify it to replicate the reported issue and share us the modified sample with the tried PDF document ? This will help us to investigate further on the issue.
FSFlorian SchwendtnerJanuary 11, 2019 10:19 AM UTC
thanks for your test project. If i change nothing, just download and run it, it will still show the initial error in this thread: "Parameter is not valid."
Then I add the line with the zoomFactor and the document is shown, but only at 100%. So the following error we are discussing now is just a child of the original error with the smaller than 1 values in the zoomFactor. What should I update that this System.Drawing error disappears?
If i add this line the document loads, but only at 100% (what makes sense) - if I delete the line it will not load anything with a zoomFactor smaller than 1.
The only thing that is not included in your sample is the System.Drawing.dll from the asp.net core - isn't it? Can you create a self-contained deployment and provide me the example? maybe you have a different dll in the GAC or something like this. Otherwise i have no idea whats so different from our computers.
KCKarthikeyan Chandrasekar Syncfusion Team January 17, 2019 11:50 AM UTC
We have installed the System.Drawing.Common in the previously provided sample but we are unable to reproduce the reported issue. So we have shared the sample with the Nuget packages which we have tried to reproduce the issue in the below link,
Kindly refer the Nuget available in ‘Packages’ folder of the provided sample manually. Please try this and revert us with the modified sample in which the issue could be reproduce and the following machine details if the issue still exists in your side .
System Bit Information:
System Culture Information:
Essential Studio Version:
Visual Studio Version:
These details will be helpful for us to investigate more on your requirement and assist you better.