Localization

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Viewer for .NET (v1)  /  Localization

DynamicPDF Viewer for .NET (v1) Forum

 Sep 14 2016 7:44 AM
Hello !

We want to use your PDF-Viewer Control (for .NET) in an german WinForms Application. Overall the Control fits our needs very well, but today i recognised that the Size of the PDF in the bottom left corner of the Viewer-Control is displayed in Inch - so my first question: Is it possible to change that to Centimeters?

The Context-Menu and the Print-Dialog are also displayed in English - so my second question: Is it possible to change the entire Control-Language or do i have to build my own Dialogs / Menus ?

Thanks for your Respone!
 Sep 14 2016 3:41 PM
Posted by a ceTe Software moderator
Hello,

You can change the display values as per your business needs by getting the dimension of the page dynamically (which will be returned as pixels) and then converting them to the desired units. Below is the code sample for it. You will need to do this in view changed and document displayed events of DynamicPDF Viewer control.

        string temp = string.Empty;
        string imageSizeLabel = "ImageSizeLabel";
        private void pdfViewer1_ViewChanged(object sender, ViewChangedEventArgs e)
        {
            //For changing the PDF dimension label text (which is at left botton corner of the Viewer).
            ceTe.DynamicPDF.Viewer.View view = pdfViewer1.GetCurrentView();
            PageVisibleArea[] VisibleAreas = pdfViewer1.GetPageVisibleArea(view);

            System.Drawing.Rectangle rect = System.Drawing.Rectangle.FromLTRB((int)VisibleAreas[0].PixelLeft, (int)VisibleAreas[0].PixelTop, (int)VisibleAreas[0].PixelRight, (int)VisibleAreas[0].PixelBottom);
            float width = (float)Math.Round((rect.Width * 0.75F) / (pdfViewer1.ZoomPercent * 72), 2);
            float height = (float)Math.Round((rect.Height * 0.75F) / (pdfViewer1.ZoomPercent * 72), 2);
            float widthInCentimeter = width * 2.54F;
            float heightInCentimeter = height * 2.54F;
            int pagenumber = VisibleAreas[0].PageNumber;
            temp = widthInCentimeter + "x" + heightInCentimeter + " cm";
            pdfViewer1.Controls[imageSizeLabel].Text = temp;
        }

In the upcoming version (v2.0) of the Viewer we have exposed this functionality as a property so you can just change the unit of measure easily by setting a single property. The beta download of v2.0 is available at here in case you would like to try.

It is not possible to change the language of the Viewer control, it is available in English only. Support for different localizations is in our feature request list but at this point we don’t have an exact timeframe on when that feature will be available.

Thanks,
ceTe Software Support Team.
 Sep 15 2016 3:07 AM
Thank you for your fast response!
I will use the code you provided.

Have a nice day.


All times are US Eastern Standard time. The time now is 11:22 AM.