');
@@ -90,6 +92,10 @@ async function getRenderedContent(note) {
function getRenderingType(note) {
let type = note.type;
+ if (type === 'file' && note.mime === 'application/pdf' && utils.isElectron()) {
+ type = 'pdf';
+ }
+
if (note.isProtected) {
if (protectedSessionHolder.isProtectedSessionAvailable()) {
protectedSessionHolder.touchProtectedSession();
@@ -104,4 +110,4 @@ function getRenderingType(note) {
export default {
getRenderedContent
-};
\ No newline at end of file
+};
diff --git a/src/public/app/widgets/type_widgets/abstract_text_type_widget.js b/src/public/app/widgets/type_widgets/abstract_text_type_widget.js
index 54f44ccfb..d28a19a36 100644
--- a/src/public/app/widgets/type_widgets/abstract_text_type_widget.js
+++ b/src/public/app/widgets/type_widgets/abstract_text_type_widget.js
@@ -36,10 +36,10 @@ export default class AbstractTextTypeWidget extends TypeWidget {
.append($link)
);
- const {renderedContent} = await noteContentRenderer.getRenderedContent(note);
+ const {renderedContent, type} = await noteContentRenderer.getRenderedContent(note);
$el.append(
- $('
')
+ $(`
`)
.append(renderedContent)
);
}
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index 29a0c832b..e61fcd418 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -693,11 +693,23 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
overflow: auto;
}
+.include-note.box-size-small .include-note-content.type-pdf {
+ height: 10em; /* PDF is rendered in iframe and must be sized absolutely */
+}
+
.include-note.box-size-medium .include-note-content {
max-height: 20em;
overflow: auto;
}
+.include-note.box-size-medium .include-note-content.type-pdf {
+ height: 20em; /* PDF is rendered in iframe and must be sized absolutely */
+}
+
+.include-note.box-size-full .include-note-content.type-pdf {
+ height: 50em; /* PDF is rendered in iframe and it's not possible to put full height so at least a large height */
+}
+
.alert-warning {
color: var(--main-text-color) !important;
background-color: var(--accented-background-color) !important;