This is really a companion post to this question and I'll make use of the scrapers I set up there.
Looking at the PDF case, we can scrape it's export data like so;
getFormatExportData["PDF"]
{"FormatName" -> "PDF", "DocumentedElements" -> None,
"Function" -> System`Convert`PDFDump`ExportPDF,
"HiddenElements" -> None, "Options" -> {"AllowRasterization"},
"Sources" -> "Convert`PDF`", "BinaryFormat" -> True,
"File" ->
"/Applications/Mathematica.app/Contents/SystemFiles/Formats/PDF/Export.m"}
And we see this odd "Sources"
element which maps to a context that can't be loaded with Get
or Needs
:
<< Convert`PDF`
Get::noopen: Cannot open Convert`PDF`.
$Failed
Digging further though into ImportExport`RegisterExport
we find a curious function called installExport
which later calls a function installSource
. This is really just a forked Get
for the different "Sources"
types, which generally just means call Get
on the package found on the System`ConvertersDump`$PackagePath
.
This is the key function for us, as calling:
System`ConvertersDump`installSource["Convert`PDF`", Automatic];
causes our export function to get loaded:
System`Convert`PDFDump`ExportPDF // DownValues // Length
4
And then we can start to dig, which shows us two interesting things:
First, PDF export really just goes through the FE. In essence it calls:
First@FrontEndExecute@
ExportPacket[
System`ConvertersDump`createVectorExportPacketExpr[expr, opts],
file,
"ConversionOptions" -> attachments
]
Second, we can figure out what some of those opts
can be by looking at System`Convert`PDFDump`getOptions
. For example, we can control the "OpacityRenderingMethod"
, "RasterizationResolution"
, and "VertexColorRenderingMethod"
directly in the Export
call.
Unfortunately, what these values can be is unclear, as this is pulled directly from the FE, but it gives a sense of how you can spelunk these I/E functions