code: public static String pdfTagAction(
          ServletRequest request,
          String format,
          String content,
          String localeStr,
          SortedMap<String, String> params,
          String paramEncoding)
      throws CmsException {
  
          CmsFlexController controller = CmsFlexController.getController(request);
          CmsObject cms = OpenCms.initCmsObject(controller.getCmsObject());
          if (localeStr != null) {
              Locale localeObj = CmsLocaleManager.getLocale(localeStr);
              cms.getRequestContext().setLocale(localeObj);
          }
          CmsResource formatterRes = cms.readResource(format);
          CmsResource contentRes = cms.readResource(content, CmsResourceFilter.ignoreExpirationOffline(cms));
          CmsPdfLink pdfLink = new CmsPdfLink(cms, formatterRes, contentRes);
          StringBuilder paramBuf = new StringBuilder();
          if ((params != null) && !params.isEmpty()) {
              paramBuf.append("?");
              List<String> paramList = new ArrayList<>();
              for (Map.Entry<String, String> entry : params.entrySet()) {
                  try {
                      paramList.add(
                          URLEncoder.encode(entry.getKey(), paramEncoding)
                              + "="
                              + URLEncoder.encode(entry.getValue(), paramEncoding));
                  } catch (UnsupportedEncodingException e) {
                      LOG.error(e.getLocalizedMessage(), e);
                  }
              }
              paramBuf.append(CmsStringUtil.listAsString(paramList, "&amp;"));
          }
          return pdfLink.getLink() + paramBuf.toString();
      }
docs: The implementation of the tag.<p>
  
  @param request the current request
  @param format the format path
  @param content the content path
  @param localeStr the name of the locale to include in the PDF link
  @param params map of parameters
  @param paramEncoding the character encoding to use for URL parameters
  
  @return the link to the PDF
  
  @throws CmsException if something goes wrong