Client Side Resize

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
ErikD
Posts: 8
Joined: Wed Jun 10, 2015 7:34 pm

Client Side Resize

Post by ErikD » Sun Jul 12, 2015 7:18 am

Hi.

Is there any way to resize the docuvieware control from the client side?

I tried this:
var dvw = document.getElementById('dvw1');
dvw.style.width = '1300px';

and that changed the size of the div, but the control seemed unaware of it and didn't re-center the image of the document.

Thanks,
ErikD

cramer
Posts: 32
Joined: Wed Mar 26, 2014 2:41 am

Re: Client Side Resize

Post by cramer » Wed Jul 22, 2015 8:17 pm

Any luck getting it to work as I also need the ability to set height and width client side...

Thanks

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Client Side Resize

Post by Loïc » Fri Jul 24, 2015 5:13 pm

Hello there,

Please check the docuvieware demo, especially at the page standalone_viewer_demo.
You will see that the DocuVieware control is automatically resized. For such purpose, just embed it within a container (a div, a span or a form) and set the Width & Height values to "100%".

Code: Select all

<cc1:DocuVieware ID="DocuVieware1" runat="server" Height="100%" Width="100%" SinglePageView="false" ForceScrollBars="False" AllowedExportFormats="*" MaxUploadSize="52428800" CollapsedSnapIn="True" EnableMouseModeButtons="False"  />
Please let me know if you need further information.

Cheers,

Loïc

cramer
Posts: 32
Joined: Wed Mar 26, 2014 2:41 am

Re: Client Side Resize

Post by cramer » Mon Jul 27, 2015 6:32 pm

Hello,

Tried your suggestion and it was a partial success...

The width of the viewer resizes correctly but the height does not adjust.

Here is the code used to test

Code: Select all

<body style="overflow: hidden; margin: 0; height: 100%;">
	<form id="form1" runat="server" style="width: 100%; height: 100%;">
		<a href="javascript:void();" onclick="Test(); return false;">Test</a>
		<br />
		<div id="divViewer" style="width: 400px; height: 400px; border: 1px solid;">
			<cc1:docuvieware id="DocuVieware1" runat="server" height="100%" width="100%" />
		</div>
	</form>
	<script type="text/javascript">
		function Test()
		{
			$("#divViewer").height('800px');
			$("#divViewer").width('800px');
		}
	</script>
</body>

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Client Side Resize

Post by Loïc » Tue Jul 28, 2015 6:43 pm

Hi,

You need to resize the form, not the viewer.

Let me know if the problem persists.

Cheers,

Loïc

cramer
Posts: 32
Joined: Wed Mar 26, 2014 2:41 am

Re: Client Side Resize

Post by cramer » Tue Jul 28, 2015 7:06 pm

Loïc wrote:Hi,

You need to resize the form, not the viewer.

Let me know if the problem persists.

Cheers,

Loïc
So resize the form element vs the div element to properly resize the viewer...???
That seems very strange to me.

Thanks.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Client Side Resize

Post by Loïc » Tue Jul 28, 2015 8:02 pm

Hello again,

Yes you are absolutely right. Please ignore my previous reply, there is definitively a bug in DocuVieware.
We will fix it for the next minor release that will be published this week.

Best regards,

Loïc

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Client Side Resize

Post by Loïc » Tue Jul 28, 2015 8:13 pm

OK. This is actually not a bug as it is impossible to handle resize event of a non window control but a feature is clearly needed.
Into the next minor release you will have to use the new UpdateLayout() api.

Here an example based on your code:

Code: Select all

    <script type="text/javascript">
        function Test() {
            $("#divViewer").height('800px');
            $("#divViewer").width('800px');
            DocuViewareAPI.UpdateLayout("DocuVieware1");
        }
    </script>
Note for readers: calling UpdateLayout() is not required when the browser's window is re-sized.

I hope this will help!

If you have any comment please let me know.

Kind regards,

Loïc

cramer
Posts: 32
Joined: Wed Mar 26, 2014 2:41 am

Re: Client Side Resize

Post by cramer » Tue Jul 28, 2015 8:47 pm

Awesome.

Looking forward to the release later this week.
Any ideas when it may be available?

Thanks

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Client Side Resize

Post by Loïc » Tue Jul 28, 2015 9:58 pm

It should be within a couple of days.
If you can't wait, we can offer a beta. Just open a ticket on our helpdesk to request it.

Cheers,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest