1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.jempbox.xmp; 18 19 import org.w3c.dom.Element; 20 21 /** 22 * Define XMP properties used with Adobe PDF documents. 23 * 24 * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a> 25 * @version $Revision: 1.2 $ 26 */ 27 public class XMPSchemaPDF extends XMPSchema 28 { 29 /** 30 * The namespace for this schema. 31 */ 32 public static final String NAMESPACE = "http://ns.adobe.com/pdf/1.3/"; 33 34 /** 35 * Construct a new blank PDF schema. 36 * 37 * @param parent The parent metadata schema that this will be part of. 38 */ 39 public XMPSchemaPDF( XMPMetadata parent ) 40 { 41 super( parent, "pdf", NAMESPACE ); 42 } 43 44 /** 45 * Constructor from existing XML element. 46 * 47 * @param element The existing element. 48 * @param prefix The schema prefix. 49 */ 50 public XMPSchemaPDF( Element element, String prefix ) 51 { 52 super( element, prefix ); 53 } 54 55 /** 56 * PDF Keywords. 57 * 58 * @param keywords The PDF keywords. 59 */ 60 public void setKeywords( String keywords ) 61 { 62 setTextProperty( prefix + ":Keywords", keywords ); 63 } 64 65 /** 66 * Get the PDF keywords. 67 * 68 * @return The PDF keywords. 69 */ 70 public String getKeywords() 71 { 72 return getTextProperty( prefix + ":Keywords" ); 73 } 74 75 /** 76 * Set the PDF file version. 1.2,1.3,... 77 * 78 * @param pdfVersion The version of the PDF file format. 79 */ 80 public void setPDFVersion( String pdfVersion ) 81 { 82 setTextProperty( prefix + ":PDFVersion", pdfVersion ); 83 } 84 85 /** 86 * Get the PDF version. 87 * 88 * @return The value of the PDF version property. 89 */ 90 public String getPDFVersion() 91 { 92 return getTextProperty( prefix + ":PDFVersion" ); 93 } 94 95 /** 96 * Set the PDF producer. 97 * 98 * @param producer The tool that created the PDF. 99 */ 100 public void setProducer( String producer ) 101 { 102 setTextProperty( prefix + ":Producer", producer ); 103 } 104 105 /** 106 * Get the value of the producer property. 107 * 108 * @return The producer property. 109 */ 110 public String getProducer() 111 { 112 return getTextProperty( prefix + ":Producer" ); 113 } 114 }