Is there an easy way to export music fragments for use in books, webpages, etc.?

I’m interested in using Dorico to typeset music fragments for inclusion in books, webpages, and so on. Is there an “easy” way to do this, with minimal post-processing and image cropping required? For example, by setting the page dimensions just small enough that the page will contain the music fragment and nothing more, and then exporting as, say, PNG or PDF.

That’s the easiest way. Create a new layout with no margins and the exact dimensions you want.

I would add that if you want to do it in one project (because they are all piano examples for example), I would create a flow for each example as well as a new layout for each flow in the way Dan described. You can also create a new master page set, which only contains a music frame with no margins and apply it automatically to all layouts

These past weeks I have had a lot of music theory assignments to assess/correct. Many times I need to put in a measure or two as examples (most of the feed back is either written on the submitted pdf., or as a text document). I will write up the “correct” solution (out of many, of course) and just take a screen shot - they inserted very easily. They might not have the resolution you need - not knowing that - but it is very quick, easy, and little if no editing involved.