我正在尝试将标准标签添加到PDF中,并且我必须在加载PDF时更新响应标题。我可以非常容易地为cq:页面添加页眉:我如何在CQ5中添加回复标题到pdf中
@SlingServlet(
resourceTypes = "cq:Page",
extensions = "html",
methods = "GET")
@Properties({
@Property(name = "service.description", value = "Servlet to handle all incoming widget modification")
})
public class canocalizePDF extends SlingAllMethodsServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
response.addHeader(“canonical", “test");
}
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
}
}
但是当我尝试使用PDF时,它不起作用。我尝试过dam:Asset,dam:AssetContent as resourceTypes,但似乎没有任何工作。
任何帮助将是伟大的。
感谢, 维沙尔
这些PDF是静态DAM资产的一部分吗? – Abhishek
是的,像/content/dam/pdf/en/citrix-workspace-suite-brochure.pdf – Vishal