You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2015/10/22 16:21:31 UTC

svn commit: r1710024 - in /pdfbox/cmssite/branches/jekyll-migration: ./ content/1.8/cookbook/ content/_layouts/ content/errors/

Author: msahyoun
Date: Thu Oct 22 14:21:31 2015
New Revision: 1710024

URL: http://svn.apache.org/viewvc?rev=1710024&view=rev
Log:
PDFBOX-3040: update missing content; add pom for maven scmp-publish

Added:
    pdfbox/cmssite/branches/jekyll-migration/pom.xml   (with props)
Modified:
    pdfbox/cmssite/branches/jekyll-migration/_config.yml
    pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/documentcreation.mdtext
    pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/encryption.md
    pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/pdfacreation.mdtext
    pdfbox/cmssite/branches/jekyll-migration/content/_layouts/default.html
    pdfbox/cmssite/branches/jekyll-migration/content/errors/403.mdtext
    pdfbox/cmssite/branches/jekyll-migration/content/errors/404.mdtext

Modified: pdfbox/cmssite/branches/jekyll-migration/_config.yml
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/_config.yml?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/_config.yml (original)
+++ pdfbox/cmssite/branches/jekyll-migration/_config.yml Thu Oct 22 14:21:31 2015
@@ -11,7 +11,7 @@ url: "http://pdfbox.apache.org/"
 
 # Build settings
 source: ./content
-destination: ./target
+destination: ./staging
 layouts_dir:  _layouts
 
 markdown_ext: "markdown,mkdown,mkdn,mkd,md,mdtext"

Modified: pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/documentcreation.mdtext
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/documentcreation.mdtext?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/documentcreation.mdtext (original)
+++ pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/documentcreation.mdtext Thu Oct 22 14:21:31 2015
@@ -29,28 +29,29 @@ document.close();
 
 This small sample shows how to create a new document and print the text "Hello World" using one of the PDF base fonts.
 
-	:::java
-	// Create a document and add a page to it
-	PDDocument document = new PDDocument();
-	PDPage page = new PDPage();
-	document.addPage( page );
-	
-	// Create a new font object selecting one of the PDF base fonts
-	PDFont font = PDType1Font.HELVETICA_BOLD;
-	
-	// Start a new content stream which will "hold" the to be created content
-	PDPageContentStream contentStream = new PDPageContentStream(document, page);
-	
-	// Define a text content stream using the selected font, moving the cursor and drawing the text "Hello World"
-	contentStream.beginText();
-	contentStream.setFont( font, 12 );
-	contentStream.moveTextPositionByAmount( 100, 700 );
-	contentStream.drawString( "Hello World" );
-	contentStream.endText();
-	
-	// Make sure that the content stream is closed:
-	contentStream.close();
-	
-	// Save the results and ensure that the document is properly closed:
-	document.save( "Hello World.pdf");
-	document.close();
\ No newline at end of file
+~~~java
+// Create a document and add a page to it
+PDDocument document = new PDDocument();
+PDPage page = new PDPage();
+document.addPage( page );
+
+// Create a new font object selecting one of the PDF base fonts
+PDFont font = PDType1Font.HELVETICA_BOLD;
+
+// Start a new content stream which will "hold" the to be created content
+PDPageContentStream contentStream = new PDPageContentStream(document, page);
+
+// Define a text content stream using the selected font, moving the cursor and drawing the text "Hello World"
+contentStream.beginText();
+contentStream.setFont( font, 12 );
+contentStream.moveTextPositionByAmount( 100, 700 );
+contentStream.drawString( "Hello World" );
+contentStream.endText();
+
+// Make sure that the content stream is closed:
+contentStream.close();
+
+// Save the results and ensure that the document is properly closed:
+document.save( "Hello World.pdf");
+document.close();
+~~~
\ No newline at end of file

Modified: pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/encryption.md
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/encryption.md?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/encryption.md (original)
+++ pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/encryption.md Thu Oct 22 14:21:31 2015
@@ -31,24 +31,25 @@ Load and save encrypted
 
 This small sample shows how to encrypt a file so that it can be viewed, but not printed..
 
-	:::java
-    PDDocument doc = PDDocument.load("filename.pdf");
+~~~java
+PDDocument doc = PDDocument.load("filename.pdf");
 
-    // Define the length of the encryption key.
-    // Possible values are 40 or 128 (256 will be available in PDFBox 2.0).
-    int keyLength = 128;
-    
-    AccessPermission ap = new AccessPermission();
-        
-    // disable printing, everything else is allowed
-    ap.setCanPrint(false);
-        
-    // owner password (to open the file with all permissions) is "12345"
-    // user password (to open the file but with restricted permissions, is empty here) 
-    StandardProtectionPolicy spp = new StandardProtectionPolicy("12345", "", ap);
-    spp.setEncryptionKeyLength(keyLength);
-    spp.setPermissions(ap);
-    doc.protect(spp);
-        
-    doc.save("filename-encrypted.pdf");
-    doc.close();
\ No newline at end of file
+// Define the length of the encryption key.
+// Possible values are 40 or 128 (256 will be available in PDFBox 2.0).
+int keyLength = 128;
+
+AccessPermission ap = new AccessPermission();
+
+// disable printing, everything else is allowed
+ap.setCanPrint(false);
+
+// owner password (to open the file with all permissions) is "12345"
+// user password (to open the file but with restricted permissions, is empty here) 
+StandardProtectionPolicy spp = new StandardProtectionPolicy("12345", "", ap);
+spp.setEncryptionKeyLength(keyLength);
+spp.setPermissions(ap);
+doc.protect(spp);
+
+doc.save("filename-encrypted.pdf");
+doc.close();
+~~~
\ No newline at end of file

Modified: pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/pdfacreation.mdtext
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/pdfacreation.mdtext?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/pdfacreation.mdtext (original)
+++ pdfbox/cmssite/branches/jekyll-migration/content/1.8/cookbook/pdfacreation.mdtext Thu Oct 22 14:21:31 2015
@@ -32,39 +32,41 @@ document. The current example creates a
 The PDF/A specification enforces that the fonts used in the document are present in the PDF File. You
 have to load them. As an example:
 
-	:::java
-	InputStream fontStream = CreatePDFA.class.getResourceAsStream("/org/apache/pdfbox/resources/ttf/ArialMT.ttf");
-	PDFont font = PDTrueTypeFont.loadTTF(doc, fontStream);
-
+~~~java
+InputStream fontStream = CreatePDFA.class.getResourceAsStream("/org/apache/pdfbox/resources/ttf/ArialMT.ttf");
+PDFont font = PDTrueTypeFont.loadTTF(doc, fontStream);
+~~~
 ## Including XMP metadata block
 
 It is imposed to have xmp metadata defined in the PDF. At least, the PDFA Schema (giving details on the version
 of PDF/A specification reached by the document) must be present. These lines create the xmp metadata for a
 PDF/A-1b document:
 
-	:::java
-	XMPMetadata xmp = new XMPMetadata();
-	XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
-	xmp.addSchema(pdfaid);
-	pdfaid.setConformance("B");
-	pdfaid.setPart(1);
-	pdfaid.setAbout("");
-	metadata.importXMPMetadata(xmp);
+~~~java
+XMPMetadata xmp = new XMPMetadata();
+XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
+xmp.addSchema(pdfaid);
+pdfaid.setConformance("B");
+pdfaid.setPart(1);
+pdfaid.setAbout("");
+metadata.importXMPMetadata(xmp);
+~~~
 
 ## Including color profile
 
 It is mandatory to include the color profile used by the document. Different profiles can be used. This 
 example takes one present in pdfbox:
 
-	:::java
-	// create output intent
-	InputStream colorProfile = CreatePDFA.class.getResourceAsStream("/org/apache/pdfbox/resources/pdfa/sRGB Color Space Profile.icm");
-	PDOutputIntent oi = new PDOutputIntent(doc, colorProfile); 
-	oi.setInfo("sRGB IEC61966-2.1"); 
-	oi.setOutputCondition("sRGB IEC61966-2.1"); 
-	oi.setOutputConditionIdentifier("sRGB IEC61966-2.1"); 
-	oi.setRegistryName("http://www.color.org"); 
-	cat.addOutputIntent(oi);
+~~~java
+// create output intent
+InputStream colorProfile = CreatePDFA.class.getResourceAsStream("/org/apache/pdfbox/resources/pdfa/sRGB Color Space Profile.icm");
+PDOutputIntent oi = new PDOutputIntent(doc, colorProfile); 
+oi.setInfo("sRGB IEC61966-2.1"); 
+oi.setOutputCondition("sRGB IEC61966-2.1"); 
+oi.setOutputConditionIdentifier("sRGB IEC61966-2.1"); 
+oi.setRegistryName("http://www.color.org"); 
+cat.addOutputIntent(oi);
+~~~~
 
 ## Complete example
 

Modified: pdfbox/cmssite/branches/jekyll-migration/content/_layouts/default.html
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/content/_layouts/default.html?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/content/_layouts/default.html (original)
+++ pdfbox/cmssite/branches/jekyll-migration/content/_layouts/default.html Thu Oct 22 14:21:31 2015
@@ -23,6 +23,7 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="description" content="{{site.description}}">
 
     <title>Apache PDFBox | {% if page.title %}{{ page.title }}{% endif %}</title>
 
@@ -43,6 +44,7 @@
     {% if headers.notice %}
         <!-- {{ headers.notice }} -->
     {% endif %}
+    
     <!-- Twitter Bootstrap and jQuery after this line. -->
     <script src="//code.jquery.com/jquery-latest.js"></script>
     <script src="/bootstrap/js/bootstrap.min.js"></script>

Modified: pdfbox/cmssite/branches/jekyll-migration/content/errors/403.mdtext
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/content/errors/403.mdtext?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/content/errors/403.mdtext (original)
+++ pdfbox/cmssite/branches/jekyll-migration/content/errors/403.mdtext Thu Oct 22 14:21:31 2015
@@ -1,5 +1,7 @@
-Title:     Forbidden (403)
-
+---
+layout: default
+title:  Forbidden (403)
+---
 # 403
 
 We're sorry, but the page you requested cannot be accessed. 

Modified: pdfbox/cmssite/branches/jekyll-migration/content/errors/404.mdtext
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/content/errors/404.mdtext?rev=1710024&r1=1710023&r2=1710024&view=diff
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/content/errors/404.mdtext (original)
+++ pdfbox/cmssite/branches/jekyll-migration/content/errors/404.mdtext Thu Oct 22 14:21:31 2015
@@ -1,5 +1,7 @@
-Title:     Page Not Found
-
+---
+layout: default
+title:  Page Not Found
+---
 # 404
 
 We're sorry, but the page you requested cannot be found. 

Added: pdfbox/cmssite/branches/jekyll-migration/pom.xml
URL: http://svn.apache.org/viewvc/pdfbox/cmssite/branches/jekyll-migration/pom.xml?rev=1710024&view=auto
==============================================================================
--- pdfbox/cmssite/branches/jekyll-migration/pom.xml (added)
+++ pdfbox/cmssite/branches/jekyll-migration/pom.xml Thu Oct 22 14:21:31 2015
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+    <!--
+! Licensed to the Apache Software Foundation (ASF) under one or more
+! contributor license agreements.  See the NOTICE file distributed with
+! this work for additional information regarding copyright ownership.
+! The ASF licenses this file to You under the Apache License, Version 2.0
+! (the "License"); you may not use this file except in compliance with
+! the License.  You may obtain a copy of the License at
+!
+!      http://www.apache.org/licenses/LICENSE-2.0
+!
+! Unless required by applicable law or agreed to in writing, software
+! distributed under the License is distributed on an "AS IS" BASIS,
+! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+! See the License for the specific language governing permissions and
+! limitations under the License.
+!-->
+
+    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+        <modelVersion>4.0.0</modelVersion>
+
+        <groupId>org.apache.pdfbox</groupId>
+        <artifactId>pdfbox-site</artifactId>
+        <version>2.0.0</version>
+
+        <name>Apache PDFBox Website</name>
+        <description>
+            The Apache PDFBox library is an open source Java tool for working with PDF documents.
+        </description>
+        <inceptionYear>2002</inceptionYear>
+
+        <properties>
+            <svn.scmContentUrl>https://svn.apache.org/repos/infra/websites/production/pdfbox/content</svn.scmContentUrl>
+        </properties>
+        
+        <build>
+            <!-- 
+            	Publish to Apache CMS
+            	After completion log in to https://cms.apache.org/pdfbox/publish 
+            	and click on the Submit button to commit to production.
+             -->
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-scm-publish-plugin</artifactId>
+                    <version>1.1</version>
+                    <configuration>
+                        <content>staging</content>
+                        <pubScmUrl>scm:svn:${svn.scmContentUrl}</pubScmUrl>
+                        <tryUpdate>true</tryUpdate>
+                        <checkoutDirectory>${svn.scmCheckoutDirectory}</checkoutDirectory>
+                        <ignorePathsToDelete>
+                            <ignorePathToDelete>docs**</ignorePathToDelete>
+                        </ignorePathsToDelete>
+                        <serverId>pdfbox-site</serverId>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </build>
+
+    </project>
\ No newline at end of file

Propchange: pdfbox/cmssite/branches/jekyll-migration/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native