Localization in ASP.NET MVC PDF Viewer
11 Sep 202022 minutes to read
The text labels provided in the PDF viewer control can be localized using the collection of localized strings using ej.PdfViewer.Locale for different cultures. By default, the PDF viewer control is localized in “en-US” culture.
The different locale value for the PDF viewer control can be specified using the locale property.
@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer")).Locale("de-DE"))
The following table shows the default values for the components in the PDF viewer control in ‘en-US’ culture:
Component |
Function |
Keywords |
Values |
toolbar | first | headerText | First |
contentText | Go to the first page of the PDF document. | ||
previous | headerText | Previous | |
contentText | Go to the previous page of the PDF document. | ||
next | headerText | Next | |
contentText | Go to the next page of the PDF document. | ||
last | headerText | Last | |
contentText | Go to the last page of the PDF document. | ||
zoomIn | headerText | Zoom-In | |
contentText | Zoom in to the PDF document. | ||
zoomOut | headerText | Zoom-Out | |
contentText | Zoom out of the PDF document. | ||
pageIndex | headerText | Page Number | |
contentText | Current page number in view. | ||
zoom | headerText | Zoom | |
contentText | Zoom in or out of the PDF document. | ||
fitToWidth | headerText | Fit to Width | |
contentText | Fit the PDF page to the width of the container. | ||
fitToPage | headerText | Fit to Page | |
contentText | Fit the PDF page to the container. | ||
headerText | |||
contentText | Print the PDF document. | ||
download | headerText | Download | |
contentText | Download the PDF document. | ||
search | headerText | Search Text | |
contentText | Search text in the PDF pages. | ||
highlight | headerText | Highlight Text | |
contentText | Highlight text in the PDF pages. | ||
strikeout | headerText | Strikethrough Text | |
contentText | Strikethrough text in the PDF pages. | ||
underline | headerText | Underline Text | |
contentText | Underline text in the PDF pages. | ||
signature | headerText | Signature | |
contentText | Add or create the hand-written signature. | ||
select | headerText | Selection | |
contentText | Selection tool for text. | ||
scroll | headerText | Panning | |
contentText | Click to pan around the document. | ||
contextMenu | copy | contentText | Copy |
googleSearch | contentText | Search Google | |
openPopup | contentText | Open Pop-Up Note | |
Delete | contentText | Delete | |
properties | contentText | Properties | |
Find | contentText | Find | |
matchCase | contentText | Match Case | |
auto | contentText | Auto | |
propertyWindow | underlineProperties | contentText | Underline Properties |
strikeOutProperties | contentText | StrikeOut Properties | |
highlightProperties | contentText | Highlight Properties | |
signatureProperties | contentText | Signature Properties | |
appearance | contentText | Appearance | |
general | contentText | General | |
color | contentText | Color | |
opacity | contentText | Opacity | |
author | contentText | Author | |
subject | contentText | Subject | |
modified | contentText | Modified | |
ok | contentText | OK | |
cancel | contentText | Cancel | |
locked | contentText | Locked | |
signatureWindow | Signature | contentText | Add Signature |
Add | contentText | Add | |
clear | contentText | Clear |
The following code snippet illustrates you to change the localization to German culture “de-DE”
@using Syncfusion.JavaScript
@using Syncfusion.MVC.EJ
<div>
<div style="width:100%;height:780px;">
@(Html.EJ().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer")).Locale("de-DE"))
</div>
</div>
@(Html.EJ().ScriptManager())
<script type="text/javascript">
$(function () {
ej.PdfViewer.Locale["de-DE"] = {
toolbar: {
first: {
headerText: 'Erste',
contentText: 'Gehen Sie auf die erste Seite des PDF-Dokument.'
},
previous: {
headerText: 'Zurück',
contentText: 'Gehen Sie auf die vorherige Seite des PDF-Dokuments.'
},
next: {
headerText: 'Nächster',
contentText: 'Gehen Sie auf die nächste Seite des PDF-Dokuments.'
},
last: {
headerText: 'Letzte',
contentText: 'Gehen Sie auf die letzte Seite des PDF-Dokuments.'
},
zoomIn: {
headerText: 'Hineinzoomen',
contentText: 'Vergrößern Sie das PDF-Dokument.'
},
zoomOut: {
headerText: 'Rauszoomen',
contentText: 'Zoom aus dem PDF-Dokument.'
},
pageIndex: {
headerText: 'Seitennummer',
contentText: 'Aktuelle Seitenzahl, um zu sehen.'
},
zoom: {
headerText: 'Zoom',
contentText: 'Vergrößern oder Verkleinern auf dem PDF-Dokument.'
},
fitToWidth: {
headerText: 'An Breite anpassen',
contentText: 'Montieren Sie die PDF-Seite an die Breite des Behälters.'
},
fitToPage: {
headerText: 'An Seite anpassen',
contentText: 'Montieren Sie die PDF-Seite in den Behälter.'
},
print: {
headerText: ' Drucken',
contentText: ' Drucken Sie das PDF-Dokument.'
},
download: {
headerText: ' Herunterladen',
contentText: ' Laden Sie das PDF-Dokument'
},
search: {
headerText: 'Suche Text',
contentText: 'Suchen Sie Text in den PDF-Seiten.'
},
highlight: {
headerText: 'hervorheben Text',
contentText: 'Markieren Sie Text in den PDF-Seiten.',
},
strikeout: {
headerText: 'StrikeOut Text',
contentText: 'Strike Out Text in den PDF-Seiten.',
},
underline: {
headerText: 'unterstreichen Text',
contentText: 'Unterstreichen Sie den Text in den PDF-Seiten.',
},
signature: {
headerText: 'Unterschrift',
contentText: 'Hinzufügen oder Erstellen der handschriftlichen Unterschrift.',
},
select: {
headerText: 'Auswahl',
contentText: 'Auswahlwerkzeug für Text.',
},
scroll: {
headerText: 'Schwenken',
contentText: 'Klicken Sie, um das Dokument zu verschieben',
}
},
contextMenu: {
copy: {
contentText: 'Kopieren',
},
googleSearch: {
contentText: 'Google suchen',
},
find: {
contentText: 'Finden:',
},
matchCase: {
contentText: 'MatchCase',
},
auto: {
contentText: 'Auto',
},
openPopup: {
contentText: 'Open Pop-Up Note',
},
delete: {
contentText: 'Löschen',
},
properties: {
contentText: 'Eigenschaften....',
},
},
propertyWindow: {
underlineProperties: {
contentText: "Unterstreichen"
},
strikeOutProperties: {
contentText: "StrikeOutProperties"
},
highlightProperties: {
contentText: "Markieren Sie die Eigenschaften"
},
signatureProperties: {
contentText: "Unterschrift Eigenschaften"
},
appearance: {
contentText: "das Auftreten"
},
general: {
contentText: "General"
},
color: {
contentText: "Farbe:"
},
opacity: {
contentText: "Opazität:"
},
author: {
contentText: "Autor:"
},
subject: {
contentText: "Fach:"
},
modified: {
contentText: "geändert:"
},
ok: {
contentText: "OK"
},
cancel: {
contentText: "stornieren"
},
locked: {
contentText: "eingesperrt"
}
},
signatureWindow: {
signature: {
contentText: "Signatur hinzufügen"
},
add: {
contentText: "Hinzufügen"
},
clear: {
contentText: "Klar"
},
}
};
});
</script>
Sample
http://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewer_Localization-1273554386
The following screenshot shows the PDF viewer with tooltip in German language.