Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:25:56+00:00 2026-06-02T16:25:56+00:00

I am having a problem publishing binaries (PDF files) from Tridion using Razor Templating.

  • 0

I am having a problem publishing binaries (PDF files) from Tridion using Razor Templating.

I have a Component Template that is set to ‘Published as a Dynamic Component’ with a single linked Multimedia Schema.

I am using the Razor Mediator eXtension and the Component Template contains two Template Building Blocks:

  1. A Razor Template that output some HTML and the link to the binary in the Multimedia Component.
  2. The Default Finish Actions TBB containing the following:
    • Publish Binaries in Package
    • Link Resolver
    • Target Group Personalization
    • Cleanup Template
    • Convert Xml to Html

The Razor Template contains the following code (I have simplified this slightly):
enter image description here

This appears to be resolving the binary link correctly and produces the following Dynamic Component Presentation:
enter image description here

The problem that I am having is that the binary itself is never added to the package and so does not get published.

As the Razor Mediator has an ‘extractBinaries’ setting in the Tridion.ContentManager.config file then I suspect that the binaries should be added on to the package by the mediator. I have made sure that the extractBinaries setting is set to ‘true’, however the binary is not being added to the package (although the Multimedia Component being processed is on the package as a tridion/component item).

Does anyone know if this functionality is available and working in the Razor Mediator please? I suspect that Razor Mediator is expecting the link code to be in a specific format, but I cannot find anything on this in the documentation.

I have also tried adding the ‘Extract Binaries from Html’ TBB to the Component Template (following the Razor Template) but I get the following error:
“The item Output must have property TCMURI specified”.
I suspect that this is due to the way that the Razor Mediator is adding the ‘Output’ item to the package.

I could write a new TBB to make sure that the binary is added to the package, but I would prefer to avoid doing this if the functionality is already available with the Razor Mediator.

Thanks in advance.

P.S. Apologies for the images. Stackoverflow didn’t want to format the code correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:25:57+00:00Added an answer on June 2, 2026 at 4:25 pm

    Unfortunately the Razor Mediator currently doesn’t add the PDF binary to the package when in an tag (thus not getting picked up by the Publish Binaries TBB), though I have a pretty good feeling that version 1.3 will be taking care of this ;).

    In the meantime, you can use a “Add Unresolved Binary Dependencies” type of TBB. I don’t have it on hand at the moment, but let me know if you need it and I’ll post the code for you later tonight.

    EDIT
    Cancel my statement about it not getting added to package, I was thinking of a different scenario.

    Try the following instead:

    <a href="@Component.ID">@Component.Metadata.title</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problem with publishing WCF service from CI (Cruise Control).. Let's say I
I am having problem with writing PDF files to browser. Other mime types work
m having problem in operating on richtextbox from another class m using backgroundworker class
I'm having problem reading from a plist file I have the Settings.plist file saved
I'm having problem when running my Windows Forms program. In the program, I have
I am having problem in getting reference of Ajax control extender using $find() or
I'm having problem restricting a query in mdx, using except function at where clause.
I am having problem that when i am trying to submit the form by
m having problem in passing parameter to controller action, i have done the following
having problem with null pointer exception and i read few article bout that error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.