Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add svg files as header option in pdf export #4443

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

anbebe
Copy link
Contributor

@anbebe anbebe commented Dec 3, 2024

Closes #3586

@@ -313,7 +313,7 @@ export class MotionViewComponent extends BaseMeetingComponent implements OnInit,
/**
* Click handler for the pdf button
*/
public downloadPdf(): void {
public async downloadPdf(): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary

Suggested change
public async downloadPdf(): Promise<void> {
public downloadPdf(): void {

Comment on lines 329 to 338
this.updateHeader([`pdf_header_l`, `pdf_header_r`]).then(() => {
this.mediaManageService
.getLogoUrlObservable(`pdf_header_l`)
.pipe(distinctUntilChanged())
.subscribe(_ => this.updateHeader([`pdf_header_l`]));
this.mediaManageService
.getLogoUrlObservable(`pdf_header_r`)
.pipe(distinctUntilChanged())
.subscribe(_ => this.updateHeader([`pdf_header_r`]));
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like this. This results in unnecessary traffic for most users when using svgs.

@bastianjoel bastianjoel assigned anbebe and unassigned bastianjoel and Elblinator Dec 9, 2024
@Elblinator Elblinator modified the milestones: 4.2, 4.3 Dec 13, 2024
@anbebe anbebe requested a review from bastianjoel January 7, 2025 13:18
@anbebe anbebe assigned bastianjoel and Elblinator and unassigned anbebe Jan 8, 2025
Copy link
Member

@Elblinator Elblinator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function

@Elblinator Elblinator removed their assignment Jan 8, 2025
Comment on lines 335 to 339
const downloads = await this.httpService.downloadAsBase64(url);
const svg = downloads.type === `image/svg+xml`;
if (svg) {
const fetchResult = await fetch(url);
const text = await fetchResult.text();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are downloading the image twice.

Comment on lines 384 to 386
} else {
return -1;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else {
return -1;
}
}
return -1;

Comment on lines 368 to 374
let viewBox: string = ``;
const width: number = this.getSizeValue(text, `width="`);
const height: number = this.getSizeValue(text, `height="`);
if (width !== -1 && height !== -1) {
viewBox = ` viewBox=" 0 0 ` + (width + 100) + ` ` + (height + 100) + `" `;
}
return viewBox;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let viewBox: string = ``;
const width: number = this.getSizeValue(text, `width="`);
const height: number = this.getSizeValue(text, `height="`);
if (width !== -1 && height !== -1) {
viewBox = ` viewBox=" 0 0 ` + (width + 100) + ` ` + (height + 100) + `" `;
}
return viewBox;
const width: number = this.getSizeValue(text, `width="`);
const height: number = this.getSizeValue(text, `height="`);
if (width !== -1 && height !== -1) {
return ` viewBox=" 0 0 ` + (width + 100) + ` ` + (height + 100) + `" `;
}
return ``;

@bastianjoel bastianjoel assigned anbebe and unassigned bastianjoel Jan 10, 2025
@anbebe anbebe assigned bastianjoel and Elblinator and unassigned anbebe Jan 10, 2025
@bastianjoel bastianjoel removed their assignment Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Motion PDF Export: export without pre-selected svg logo
3 participants