Part of what got me thinking about this was this question about whether Federation transporters use matter or energy and my answer. My answer is taken from the Star Trek: The Next Generation Writers' Technical Manual, Fourth Season Edition. This is sent to all writers and prospective writers (that's how I got it) as the official source of how everything technical works in Star Trek.
On the larger section on the transporter (and not the short summary), On page 28, under The Transporter - Once and for All:
... The stream of molecules read by the pads is sent to the Pattern Buffer, a large cylindrical tank surrounded by superconducting electromagnetic coils. It is here that the object to be transported is stored momentarily before actual beaming away from the ship (or even within the ship). It is the Pattern Buffer and its associated subsystems that have been improved the most in the last half-century. While the actual molecules of an object are held in a spinning magnetic suspension (eight minutes before degradation), the construction sequence of the object can be read, recorded in computer memory (in some cases), and reproduced. There are limits to the complexity of the object, however, and this is where the potential "miracle" machine still eludes.
The Transporter cannot produce working duplicate copies of living tissue or organ systems.
The reason for this is that routine transport involves handling the incredibly vast amount of information required to "disassemble" and "reassemble" a human being or other life form. To transport something, the system must scan, process, and transmit this pattern information. This is analogous to a television, which serves as a conduit to the vast amount of visual information in a normal television transmission.
And then, from the same section, on page 29:
From the Pattern Buffer, the molecular stream and the coded instructions pass through a number of subsystems before reaching the emitter. These include the Subspace, Doppler, and Heisenberg Compensators. Each works to insure that the matter stream is being transmitted or received is in the correct phase, frequency, and so on. (sic)
In short, objects are disassembled by the transporter, the molecules and data about them (like brownian motion) will all be stored and transmitted and re-assembled. This pretty much blows the whole "matter-energy scrambler" theory out of the water and says that the transporter does not change matter to energy and back again.
Yet in the same tech manual, on page 12, under Transporter (this is the shorter summary section), we have this:
Replication technology: The ability to convert matter into energy and back again implies the ability to replicate objects. This is done in the ship's food service units which instantly recreate any dish in the computer's memory.
(I am not using selective quotations or hiding anything relevant, so this is not a game I'm playing by revealing only selected information from the guide.)
The problem here is that, as described in the tech manual itself, the transporter does not convert matter to energy. It creates a stream of matter and reassembles it at the destination.
As I understand this, it would mean that the replicators could replicate material made of the same molecules of whatever is in storage. For example, if you have enough raw carbon molecules, they could be re-assembled into a diamond or graphite, but they could not be broken down through energy/matter conversion and used to make a piece of iron.
Is this (using a matter stream for transport) totally incompatible with replicator technology? Or is there a way, using the transporter technology as described, to still provide replicator technology as we've seen in Star Trek?