Skip to content

Commit

Permalink
[frontend] Fix the PDF export
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Aug 30, 2022
1 parent e892801 commit 287df15
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ services:
- name: redis
image: redis:7.0.4
- name: elastic
image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.1
environment:
discovery.type: single-node
xpack.security.enabled: false
ES_JAVA_OPTS: -Xms2g -Xmx2g
- name: minio
image: minio/minio:RELEASE.2022-08-13T21-54-44Z
image: minio/minio:RELEASE.2022-08-26T19-53-15Z
environment:
MINIO_ROOT_USER: ChangeMe
MINIO_ROOT_PASSWORD: ChangeMe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ import {
} from '../../../../utils/ListParameters';
import Loader from '../../../../components/Loader';
import StixDomainObjectContentBar from './StixDomainObjectContentBar';
import RobotoRegular from '../../../../static/fonts/Roboto-Regular.ttf';
import RobotoBold from '../../../../static/fonts/Roboto-Bold.ttf';
import RobotoItalic from '../../../../static/fonts/Roboto-Italic.ttf';
import RobotoBoldItalic from '../../../../static/fonts/Roboto-BoldItalic.ttf';

pdfjs.GlobalWorkerOptions.workerSrc = `${APP_BASE_PATH}/static/ext/pdf.worker.min.js`;

Expand Down Expand Up @@ -349,12 +345,14 @@ class StixDomainObjectContentComponent extends Component {
content: ret.content,
images,
};
const { protocol, hostname, port } = window.location;
const url = `${protocol}//${hostname}:${port || ''}`;
const fonts = {
Roboto: {
normal: `${APP_BASE_PATH}${RobotoRegular}`,
bold: `${APP_BASE_PATH}${RobotoBold}`,
italics: `${APP_BASE_PATH}${RobotoItalic}`,
bolditalics: `${APP_BASE_PATH}${RobotoBoldItalic}`,
normal: `${url}${APP_BASE_PATH}/static/ext/Roboto-Regular.ttf`,
bold: `${url}${APP_BASE_PATH}/static/ext/Roboto-Bold.ttf`,
italics: `${url}${APP_BASE_PATH}/static/ext/Roboto-Italic.ttf`,
bolditalics: `${url}${APP_BASE_PATH}/static/ext/Roboto-BoldItalic.ttf`,
},
};
const fragment = currentFileId.split('/');
Expand Down

0 comments on commit 287df15

Please sign in to comment.