Skip to content

Implement to_svg for DisplayList#166

Merged
messense merged 1 commit into
messense:mainfrom
jackpot51:main
Aug 25, 2025
Merged

Implement to_svg for DisplayList#166
messense merged 1 commit into
messense:mainfrom
jackpot51:main

Conversation

@jackpot51

Copy link
Copy Markdown
Contributor

This implementation is very similar to the one for Page, but allows for threaded SVG creation.

Comment thread mupdf-sys/wrapper.c
buf = fz_new_buffer(ctx, 1024);
out = fz_new_output_with_buffer(ctx, buf);
dev = fz_new_svg_device(ctx, out, tbounds.x1 - tbounds.x0, tbounds.y1 - tbounds.y0, FZ_SVG_TEXT_AS_PATH, 1);
fz_run_display_list(ctx, list, dev, ctm, tbounds, cookie);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not completely sure if mediabox or tbounds should be used for the area here.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Not sure either, I guess we'll know better when it gets used in real world applications.

@messense messense left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks!

Comment thread mupdf-sys/wrapper.c
buf = fz_new_buffer(ctx, 1024);
out = fz_new_output_with_buffer(ctx, buf);
dev = fz_new_svg_device(ctx, out, tbounds.x1 - tbounds.x0, tbounds.y1 - tbounds.y0, FZ_SVG_TEXT_AS_PATH, 1);
fz_run_display_list(ctx, list, dev, ctm, tbounds, cookie);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Not sure either, I guess we'll know better when it gets used in real world applications.

@messense messense merged commit baf94ff into messense:main Aug 25, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants