I am having trouble publishing binary files (PDF files) from Tridion using Razor Templating.
I have a component template that is configured to "Published as a dynamic component" with a single, connected multimedia scheme.
I am using Razor Mediator eXtension , and the component template contains two templates:
- A Razor template that outputs some HTML and a link to a binary file in a multimedia component.
- Default TBB completion steps that include the following:
- Publishing binary files in a package
- Link resolver
- Target group personalization
- Cleaning pattern
- Convert Xml to HTML
The Razor template contains the following code (I simplified this a bit): 
This apparently resolves the binary link correctly and creates the following dynamic representation of the components: 
The problem that I encountered is that the binarium itself is never added to the package and therefore is not published.
Since the Razor broker has an extractBinaries parameter in the Tridion.ContentManager.config file, I suspect that the binaries should be added to the package by the broker. I made sure that the extractBinaries parameter is set to true, but the binary is not added to the package (although the processed media component is in the package as a tridion / component element).
Does anyone know if this functionality is available and does the Razor broker work? I suspect that the Razor Mediator reseller expects the link code to be in a specific format, but I cannot find anything on this in the documentation .
I also tried adding the "Extract binary from Html" TBB to the component template (after the Razor template), but I get the following error: "The Output element must have the TCMURI property specified." I suspect this is because the Razor Mediator reseller adds an Exit item to the package.
I could write a new TBB to make sure the binary was added to the package, but I would prefer not to do this if the functionality is already available through the Razor broker.
Thanks in advance.
PS Apologies for the images. Stackoverflow did not want to format the code correctly.
source share