diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index 5c0e3ada9..57072c73d 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -586,6 +586,12 @@
"textSubject": "Subject",
"textSymbols": "Symbols",
"textTitle": "Title",
+ "textPageSize": "Page Size",
+ "textPdfVer": "PDF Version",
+ "textPdfTagged": "Tagged PDF",
+ "textFastWV": "Fast Web View",
+ "textYes": "Yes",
+ "textNo": "No",
"textTop": "Top",
"textUnitOfMeasurement": "Unit Of Measurement",
"textUploaded": "Uploaded",
diff --git a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx
index e97a7016a..72ef0f16a 100644
--- a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx
+++ b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx
@@ -1,20 +1,100 @@
import React, { Component } from "react";
import { observer, inject } from "mobx-react";
import DocumentInfo from "../../view/settings/DocumentInfo";
+import { withTranslation } from 'react-i18next';
class DocumentInfoController extends Component {
constructor(props) {
super(props);
this.docProps = this.getDocProps();
+ this.pdfProps = this.getPdfProps();
+ this.docInfoObject = {};
+
+ this.getAppProps = this.getAppProps.bind(this);
if(this.docProps) {
- this.modified = this.getModified();
- this.modifiedBy = this.getModifiedBy();
- this.creators = this.getCreators();
- this.title = this.getTitle();
- this.subject = this.getSubject();
- this.description = this.getDescription();
- this.created = this.getCreated();
+ this.updateFileInfo(this.docProps);
+ } else if (this.pdfProps) {
+ this.updatePdfInfo(this.pdfProps);
+ }
+ }
+
+ updateFileInfo(props) {
+ let value;
+
+ if(props) {
+ value = props.asc_getCreated();
+ if(value) this.docInfoObject.dateCreated = this.getModified(value);
+
+ value = props.asc_getModified();
+ if(value) this.docInfoObject.modifyDate = this.getModified(value);
+
+ value = props.asc_getLastModifiedBy();
+ if(value) this.docInfoObject.modifyBy = AscCommon.UserInfoParser.getParsedName(value);
+
+ this.docInfoObject.title = props.asc_getTitle() || '';
+ this.docInfoObject.subject = props.asc_getSubject() || '';
+ this.docInfoObject.description = props.asc_getDescription() || '';
+
+ value = props.asc_getCreator();
+ if(value) this.docInfoObject.creators = value;
+ }
+ }
+
+ updatePdfInfo(props) {
+ const { t } = this.props;
+ const _t = t("Settings", { returnObjects: true });
+ let value;
+
+ if(props) {
+ value = props.CreationDate;
+ if (value)
+ this.docInfoObject.dateCreated = this.getModified(new Date(value));
+
+ value = props.ModDate;
+ if (value)
+ this.docInfoObject.modifyDate = this.getModified(new Date(value));
+
+ if(props.PageWidth && props.PageHeight && (typeof props.PageWidth === 'number') && (typeof props.PageHeight === 'number')) {
+ let width = props.PageWidth,
+ heigth = props.PageHeight;
+ switch(Common.Utils.Metric.getCurrentMetric()) {
+ case Common.Utils.Metric.c_MetricUnits.cm:
+ width = parseFloat((width* 25.4 / 72000.).toFixed(2));
+ heigth = parseFloat((heigth* 25.4 / 72000.).toFixed(2));
+ break;
+ case Common.Utils.Metric.c_MetricUnits.pt:
+ width = parseFloat((width/100.).toFixed(2));
+ heigth = parseFloat((heigth/100.).toFixed(2));
+ break;
+ case Common.Utils.Metric.c_MetricUnits.inch:
+ width = parseFloat((width/7200.).toFixed(2));
+ heigth = parseFloat((heigth/7200.).toFixed(2));
+ break;
+ }
+
+ this.docInfoObject.pageSize = (width + ' ' + Common.Utils.Metric.getCurrentMetricName() + ' x ' + heigth + ' ' + Common.Utils.Metric.getCurrentMetricName());
+ } else this.docInfoObject.pageSize = null;
+
+ value = props.Title;
+ if(value) this.docInfoObject.title = value;
+
+ value = props.Subject;
+ if(value) this.docInfoObject.subject = value;
+
+ value = props.Author;
+ if(value) this.docInfoObject.author = value;
+
+ value = props.Version;
+ if(value) this.docInfoObject.version = value;
+
+ value = props.Tagged;
+ if (value !== undefined)
+ this.docInfoObject.tagged = (value===true ? _t.textYes : _t.textNo);
+
+ value = props.FastWebView;
+ if (value !== undefined)
+ this.docInfoObject.fastWebView = (value===true ? _t.textYes : _t.textNo);
}
}
@@ -23,21 +103,29 @@ class DocumentInfoController extends Component {
return api.asc_getCoreProps();
}
+ getPdfProps() {
+ const api = Common.EditorApi.get();
+ return api.asc_getPdfProps();
+ }
+
getAppProps() {
const api = Common.EditorApi.get();
const appProps = api.asc_getAppProps();
+ let appName;
if (appProps) {
- let appName =
- (appProps.asc_getApplication() || "") +
- (appProps.asc_getAppVersion() ? " " : "") +
- (appProps.asc_getAppVersion() || "");
+ appName = appProps.asc_getApplication();
+ if ( appName && appProps.asc_getAppVersion() )
+ appName += ` ${appProps.asc_getAppVersion()}`;
+
+ return appName || '';
+ } else if (this.pdfProps) {
+ appName = this.pdfProps ? this.pdfProps.Producer || '' : '';
return appName;
}
}
- getModified() {
- let valueModified = this.docProps.asc_getModified();
+ getModified(valueModified) {
const _lang = this.props.storeAppOptions.lang;
if (valueModified) {
@@ -53,39 +141,6 @@ class DocumentInfoController extends Component {
}
}
- getModifiedBy() {
- let valueModifiedBy = this.docProps.asc_getLastModifiedBy();
-
- if (valueModifiedBy) {
- return AscCommon.UserInfoParser.getParsedName(valueModifiedBy);
- }
- }
-
- getCreators() {
- return this.docProps.asc_getCreator();
- }
-
- getTitle() {
- return this.docProps.asc_getTitle();
- }
-
- getSubject() {
- return this.docProps.asc_getSubject();
- }
-
- getDescription() {
- return this.docProps.asc_getDescription();
- }
-
- getCreated() {
- let value = this.docProps.asc_getCreated();
- const _lang = this.props.storeAppOptions.lang;
-
- if(value) {
- return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'});
- }
- }
-
componentDidMount() {
const api = Common.EditorApi.get();
api.startGetDocInfo();
@@ -95,17 +150,11 @@ class DocumentInfoController extends Component {
return (
);
}
}
-export default inject("storeAppOptions")(observer(DocumentInfoController));
\ No newline at end of file
+export default inject("storeAppOptions")(observer(withTranslation()(DocumentInfoController)));
diff --git a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx
index 21f4fb3f0..d45a1bf04 100644
--- a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx
+++ b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx
@@ -7,6 +7,8 @@ const PageDocumentInfo = (props) => {
const { t } = useTranslation();
const _t = t("Settings", { returnObjects: true });
const storeInfo = props.storeDocumentInfo;
+ const fileType = storeInfo.dataDoc.fileType;
+
const dataApp = props.getAppProps();
const {
@@ -17,6 +19,21 @@ const PageDocumentInfo = (props) => {
wordsCount,
} = storeInfo.infoObj;
+ const {
+ pageSize,
+ title,
+ subject,
+ description,
+ dateCreated,
+ modifyBy,
+ modifyDate,
+ author,
+ version,
+ tagged,
+ fastWebView,
+ creators
+ } = props.docInfoObject;
+
const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
const isLoaded = storeInfo.isLoaded;
@@ -62,70 +79,87 @@ const PageDocumentInfo = (props) => {
+ {pageSize && }
- {props.title ? (
+ {title ? (
- {_t.textTitle}
+ {t('Settings.textTitle')}
-
+
) : null}
- {props.subject ? (
+ {subject ? (
- {_t.textSubject}
+ {t('Settings.textSubject')}
-
+
) : null}
- {props.description ? (
+ {description ? (
- {_t.textComment}
+ {t('Settings.textComment')}
-
+
) : null}
- {props.modified ? (
+ {modifyDate ? (
- {_t.textLastModified}
+ {t('Settings.textLastModified')}
-
+
) : null}
- {props.modifiedBy ? (
+ {modifyBy ? (
- {_t.textLastModifiedBy}
+ {t('Settings.textLastModifiedBy')}
-
+
) : null}
- {props.created ? (
+ {dateCreated ? (
- {_t.textCreated}
+ {t('Settings.textCreated')}
-
+
) : null}
{dataApp ? (
- {_t.textApplication}
+ {t('Settings.textApplication')}
) : null}
- {props.creators ? (
+ {fileType === 'xps' && author ? (
- {_t.textAuthor}
+ {t('Settings.textAuthor')}
+
+
+
+
+ ) : null}
+ { fileType === 'pdf' ? (
+
+
+
+
+
+
+ ) : null}
+ {creators ? (
+
+ {t('Settings.textAuthor')}
{
- props.creators.split(/\s*[,;]\s*/).map(item => {
- return
+ creators.split(/\s*[,;]\s*/).map(item => {
+ return
})
}