Skip to content

Commit

Permalink
Revert "Process language attribute"
Browse files Browse the repository at this point in the history
This reverts commit 91ee687.
  • Loading branch information
pbrant committed Nov 7, 2017
1 parent ca8f96d commit afca924
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@
* @see http://www.seoconsultants.com/meta-tags/dublin/
*/
public class XHtmlMetaToPdfInfoAdapter extends DefaultPDFCreationListener {
private static final String HTML_TAG_TITLE = "title";
private static final String HTML_TAG_HTML = "html";
private static final String HTML_TAG_HTML_ATTR_LANG = "lang";
private static final String HTML_TAG_TITLE = "title";
private static final String HTML_TAG_HEAD = "head";
private static final String HTML_TAG_META = "meta";
private static final String HTML_META_KEY_TITLE = "title";
Expand Down Expand Up @@ -160,15 +158,7 @@ private void parseHtmlTags( Document doc ) {

private void parseHtmlTitleTag( Document doc ) {

Element htmlElement = doc.getDocumentElement();
String language = htmlElement.getAttribute( HTML_TAG_HTML_ATTR_LANG );
if ( language.length() != 0 ) {
PdfName pdfName = PdfName.LANG;
PdfString pdfString = new PdfString( language );
this.pdfInfoValues.put( pdfName, pdfString );
}

NodeList headNodeList = htmlElement.getElementsByTagName( HTML_TAG_HEAD );
NodeList headNodeList = doc.getDocumentElement().getElementsByTagName( HTML_TAG_HEAD );
XRLog.render(Level.FINEST, "headNodeList=" + headNodeList );
Element rootHeadNodeElement = (Element) headNodeList.item( 0 );
NodeList titleNodeList = rootHeadNodeElement.getElementsByTagName( HTML_TAG_TITLE );
Expand All @@ -180,8 +170,8 @@ private void parseHtmlTitleTag( Document doc ) {
XRLog.render(Level.FINEST, "titleElement.value=" + titleElement.getNodeValue() );
XRLog.render(Level.FINEST, "titleElement.content=" + titleElement.getTextContent() );
String titleContent = titleElement.getTextContent();
pdfName = PdfName.TITLE;
pdfString = new PdfString( titleContent );
PdfName pdfName = PdfName.TITLE;
PdfString pdfString = new PdfString( titleContent );
this.pdfInfoValues.put( pdfName, pdfString );
}
}
Expand Down

1 comment on commit afca924

@drbgfc
Copy link

@drbgfc drbgfc commented on afca924 Feb 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, since we aren't processing the language attribute, what is the suggested way to encode language so that it is transformed into a PDF property? Apologies if it is in the documentation as I missed it. Thanks.

Please sign in to comment.