├── .gitignore
├── Copy of swinglabs-build-impl.xml
├── build-before-management.xml
├── build-before-profiler.xml
├── build.xml
├── demos
└── viewer
│ └── com
│ └── sun
│ └── pdfview
│ ├── Flag.java
│ ├── FullScreenWindow.java
│ ├── PDFPrintPage.java
│ ├── PDFViewer.java
│ ├── PageChangeListener.java
│ ├── PagePanel.java
│ ├── ThumbPanel.java
│ └── gfx
│ ├── first.gif
│ ├── fit.gif
│ ├── fullscrn.gif
│ ├── last.gif
│ ├── next.gif
│ ├── open.gif
│ ├── prev.gif
│ ├── print.gif
│ ├── zoom.gif
│ ├── zoomin.gif
│ └── zoomout.gif
├── doc
├── 32000-1-2008
│ ├── 5176.CFF.pdf
│ ├── OTGuide.pdf
│ ├── PDF32000_2008.pdf
│ └── adobe_supplement_iso32000.pdf
├── 5040.Download_Fonts.pdf
├── 5121.CLUT.pdf
├── Apple True Type Font Reference.url
├── CCITT.T-REC-T.4-200307-I!!PDF-E[1].pdf
├── CCITT.T-REC-T.6-198811-I!!PDF-E[1].pdf
├── CMAP files
│ ├── 5014.CIDFont_Spec.pdf
│ ├── 5148.SING_Tutorial.pdf
│ ├── 5149.OTFname_Tutorial.pdf
│ ├── 5180.sfnt.pdf
│ ├── 5640.CJK_Fonts.pdf
│ ├── 5641.CID_Embed.pdf
│ ├── 5901.Kazuraki_Tutorial.pdf
│ ├── Character to Glyph Mapping Table.mht
│ ├── chinese_t.zip
│ ├── japanese.zip
│ ├── korean.zip
│ └── otf_jis2004.tar
├── ICC1v42_2006-05.pdf
├── PDFlib-tutorial.pdf
├── PostscriptLanguageReferenceManual.pdf
├── TN5603.Filters.pdf
├── opentypeSpec.zip
├── opentypeSpec
│ └── Typography
│ │ └── otspec
│ │ ├── 5176.CFF.pdf
│ │ ├── 5177.Type2.pdf
│ │ ├── IMG00269.GIF
│ │ ├── IMG00270.GIF
│ │ ├── IMG00271.GIF
│ │ ├── IMG00272.GIF
│ │ ├── IMG00273.GIF
│ │ ├── IMG00274.GIF
│ │ ├── IMG00275.GIF
│ │ ├── IMG00276.GIF
│ │ ├── IMG00277.GIF
│ │ ├── IMG00278.GIF
│ │ ├── IMG00279.GIF
│ │ ├── IMG00280.GIF
│ │ ├── IMG00281.GIF
│ │ ├── IMG00282.GIF
│ │ ├── IMG00286.GIF
│ │ ├── IMG00287.GIF
│ │ ├── IMG00288.GIF
│ │ ├── IMG00289.GIF
│ │ ├── IMG00290.GIF
│ │ ├── IMG00291.GIF
│ │ ├── IMG00292.GIF
│ │ ├── IMG00293.GIF
│ │ ├── IMG00294.GIF
│ │ ├── IMG00295.GIF
│ │ ├── IMG00296.GIF
│ │ ├── IMG00297.GIF
│ │ ├── IMG00298.GIF
│ │ ├── IMG00299.GIF
│ │ ├── IMG00300.GIF
│ │ ├── IMG00301.GIF
│ │ ├── IMG00302.GIF
│ │ ├── IMG00303.GIF
│ │ ├── IMG00304.GIF
│ │ ├── IMG00305.GIF
│ │ ├── IMG00306.GIF
│ │ ├── IMG00307.GIF
│ │ ├── IMG00308.GIF
│ │ ├── IMG00309.GIF
│ │ ├── IMG00310.GIF
│ │ ├── IMG00311.GIF
│ │ ├── IMG00312.GIF
│ │ ├── IMG00313.GIF
│ │ ├── Img000283.gif
│ │ ├── Img00283.gif
│ │ ├── Img00284.gif
│ │ ├── Img00285.gif
│ │ ├── Img00302b.gif
│ │ ├── Thumbs.db
│ │ ├── about.htm
│ │ ├── attach.gif
│ │ ├── b1.gif
│ │ ├── b2.gif
│ │ ├── b3.gif
│ │ ├── b4.gif
│ │ ├── b5.gif
│ │ ├── b6.gif
│ │ ├── b7.gif
│ │ ├── b8.gif
│ │ ├── b9.gif
│ │ ├── ball.gif
│ │ ├── base.htm
│ │ ├── baselinetags.htm
│ │ ├── baserule.gif
│ │ ├── cff.htm
│ │ ├── cff.pdf
│ │ ├── cffspec.htm
│ │ ├── changes.htm
│ │ ├── chapter2.htm
│ │ ├── charstr2.htm
│ │ ├── cmap.htm
│ │ ├── cvt.htm
│ │ ├── default.htm
│ │ ├── dsig.htm
│ │ ├── ebdt.htm
│ │ ├── eblc.htm
│ │ ├── ebsc.htm
│ │ ├── euro.htm
│ │ ├── featurelist.htm
│ │ ├── features_ae.htm
│ │ ├── features_fj.htm
│ │ ├── features_ko.htm
│ │ ├── features_pt.htm
│ │ ├── features_uz.htm
│ │ ├── featuretags.htm
│ │ ├── fg1a.gif
│ │ ├── fig1a.gif
│ │ ├── fig1b.gif
│ │ ├── fig1c.gif
│ │ ├── fig1d.gif
│ │ ├── fig1e.gif
│ │ ├── fig1f.gif
│ │ ├── fig1g.gif
│ │ ├── fig1h.gif
│ │ ├── fig1i.gif
│ │ ├── fig2a.gif
│ │ ├── fig2b.gif
│ │ ├── fig2c.gif
│ │ ├── fig2d.gif
│ │ ├── fig3a.gif
│ │ ├── fig3b.gif
│ │ ├── fig3c.gif
│ │ ├── fig3d.gif
│ │ ├── fig3e.gif
│ │ ├── fig3f.gif
│ │ ├── fig3g.gif
│ │ ├── fig4a.gif
│ │ ├── fig4b.gif
│ │ ├── fig4c.gif
│ │ ├── fig4d.gif
│ │ ├── fig4e.gif
│ │ ├── fig4f.gif
│ │ ├── fig5a.gif
│ │ ├── fig5b.gif
│ │ ├── fig5c.gif
│ │ ├── fig5d.gif
│ │ ├── fig6a.gif
│ │ ├── fig6b.gif
│ │ ├── fig6c.gif
│ │ ├── fig7a.gif
│ │ ├── fig7b.gif
│ │ ├── fig7c.gif
│ │ ├── fpgm.htm
│ │ ├── gasp.htm
│ │ ├── gdef.htm
│ │ ├── glyf.htm
│ │ ├── gpos.htm
│ │ ├── grstate.doc
│ │ ├── gsub.htm
│ │ ├── hdmx.htm
│ │ ├── head.htm
│ │ ├── hhea.htm
│ │ ├── hmtx.htm
│ │ ├── ibmfc.htm
│ │ ├── instgly.doc
│ │ ├── jstf.htm
│ │ ├── kern.htm
│ │ ├── languagetags.htm
│ │ ├── lcid-cp.txt
│ │ ├── loca.htm
│ │ ├── ltsh.htm
│ │ ├── maxp.htm
│ │ ├── midrule.gif
│ │ ├── name.htm
│ │ ├── namesmp.htm
│ │ ├── neweuro.gif
│ │ ├── nlc1.gif
│ │ ├── nlc2.gif
│ │ ├── notdef.gif
│ │ ├── os2.htm
│ │ ├── os2ver0.htm
│ │ ├── os2ver1.htm
│ │ ├── os2ver2.htm
│ │ ├── otff.htm
│ │ ├── otlist.htm
│ │ ├── otover.htm
│ │ ├── otspec.css
│ │ ├── ottm.htm
│ │ ├── pcapprop.gif
│ │ ├── pclt.htm
│ │ ├── pixel.gif
│ │ ├── post.htm
│ │ ├── prep.htm
│ │ ├── proposals.htm
│ │ ├── recom.htm
│ │ ├── scripttags.htm
│ │ ├── tablist.htm
│ │ ├── toprule.gif
│ │ ├── trial_text.html
│ │ ├── ttch01.htm
│ │ ├── ttinst.htm
│ │ ├── ttinst1.doc
│ │ ├── ttinst2.doc
│ │ ├── ttochap1.htm
│ │ ├── ttoreg.htm
│ │ ├── type2.pdf
│ │ ├── unicprop.gif
│ │ ├── vdmx.htm
│ │ ├── vhea.htm
│ │ ├── vmtx.htm
│ │ ├── vorg.htm
│ │ ├── w0.gif
│ │ ├── w1.gif
│ │ ├── w2.gif
│ │ ├── w3.gif
│ │ ├── w4.gif
│ │ ├── w5.gif
│ │ ├── w6.gif
│ │ ├── w7.gif
│ │ ├── w8.gif
│ │ ├── wgl4.htm
│ │ ├── wgl4b.htm
│ │ ├── wgl4c.htm
│ │ ├── wgl4d.htm
│ │ └── wgl4e.htm
├── otsp14.exe
├── parts
│ ├── PDF17Errata.pdf
│ ├── pdf_implementation.pdf
│ ├── pdf_reference.pdf
│ └── pdf_reference_addendum_redaction.pdf
├── pdf_17_errata.pdf
├── pdf_reference.pdf
├── pdf_reference1-7_addendum_redaction.pdf
└── pdf_reference_1-7.pdf
├── lib
└── readme.txt
├── manifest.mf
├── master-application.jnlp
├── master.jnlp
├── nbproject
├── build-impl.xml
├── build-impl.xml.bak
├── configs
│ ├── FontToy.properties
│ ├── JWS_generated.properties
│ └── no_thumb.properties
├── genfiles.properties
├── jnlp-impl.xml
├── management-build-impl.xml
├── private
│ ├── config.properties
│ ├── configs
│ │ └── FontToy.properties
│ ├── private.properties
│ ├── private.xml
│ └── profiler
│ │ ├── configurations.xml
│ │ └── snapshot-1234189049270.nps
├── profiler-build-impl.xml
├── project.properties
└── project.xml
├── src
├── com
│ └── sun
│ │ └── pdfview
│ │ ├── BaseWatchable.java
│ │ ├── Cache.java
│ │ ├── HexDump.java
│ │ ├── Identity8BitCharsetEncoder.java
│ │ ├── ImageInfo.java
│ │ ├── NameTree.java
│ │ ├── OutlineNode.java
│ │ ├── PDFCmd.java
│ │ ├── PDFDestination.java
│ │ ├── PDFDocCharsetEncoder.java
│ │ ├── PDFFile.java
│ │ ├── PDFImage.java
│ │ ├── PDFObject.java
│ │ ├── PDFPage.java
│ │ ├── PDFPaint.java
│ │ ├── PDFParseException.java
│ │ ├── PDFParser.java
│ │ ├── PDFRenderer.java
│ │ ├── PDFShapeCmd.java
│ │ ├── PDFStringUtil.java
│ │ ├── PDFTextFormat.java
│ │ ├── PDFXref.java
│ │ ├── RefImage.java
│ │ ├── Watchable.java
│ │ ├── action
│ │ ├── GoToAction.java
│ │ └── PDFAction.java
│ │ ├── colorspace
│ │ ├── AlternateColorSpace.java
│ │ ├── CMYKColorSpace.java
│ │ ├── CalGrayColor.java
│ │ ├── CalRGBColor.java
│ │ ├── IndexedColor.java
│ │ ├── LabColor.java
│ │ ├── MaskColorSpace.java
│ │ ├── PDFColorSpace.java
│ │ ├── PatternSpace.java
│ │ └── sGray.icc
│ │ ├── decode
│ │ ├── ASCII85Decode.java
│ │ ├── ASCIIHexDecode.java
│ │ ├── CCITTCodes
│ │ ├── CCITTFaxDecode.java
│ │ ├── CCITTFaxDecoder.java
│ │ ├── DCTDecode.java
│ │ ├── FlateDecode.java
│ │ ├── LZWDecode.java
│ │ ├── PDFDecoder.java
│ │ ├── PNGPredictor.java
│ │ ├── Predictor.java
│ │ └── RunLengthDecode.java
│ │ ├── decrypt
│ │ ├── CryptFilterDecrypter.java
│ │ ├── EncryptionUnsupportedByPlatformException.java
│ │ ├── EncryptionUnsupportedByProductException.java
│ │ ├── IdentityDecrypter.java
│ │ ├── PDFAuthenticationFailureException.java
│ │ ├── PDFDecrypter.java
│ │ ├── PDFDecrypterFactory.java
│ │ ├── PDFPassword.java
│ │ ├── StandardDecrypter.java
│ │ └── UnsupportedEncryptionException.java
│ │ ├── font
│ │ ├── BuiltinFont.java
│ │ ├── CIDFontType2.java
│ │ ├── FlPoint.java
│ │ ├── FontSupport.java
│ │ ├── NativeFont.java
│ │ ├── OutlineFont.java
│ │ ├── PDFCMap.java
│ │ ├── PDFFont.java
│ │ ├── PDFFontDescriptor.java
│ │ ├── PDFFontEncoding.java
│ │ ├── PDFGlyph.java
│ │ ├── TTFFont.java
│ │ ├── Type0Font.java
│ │ ├── Type1CFont.java
│ │ ├── Type1Font.java
│ │ ├── Type3Font.java
│ │ ├── res
│ │ │ ├── BaseFonts.properties
│ │ │ ├── d050000l.pfb
│ │ │ ├── n019003l.pfb
│ │ │ ├── n019004l.pfb
│ │ │ ├── n019023l.pfb
│ │ │ ├── n019024l.pfb
│ │ │ ├── n021003l.pfb
│ │ │ ├── n021004l.pfb
│ │ │ ├── n021023l.pfb
│ │ │ ├── n021024l.pfb
│ │ │ ├── n022003l.pfb
│ │ │ ├── n022004l.pfb
│ │ │ ├── n022023l.pfb
│ │ │ ├── n022024l.pfb
│ │ │ └── s050000l.pfb
│ │ └── ttf
│ │ │ ├── AdobeGlyphList.java
│ │ │ ├── CMap.java
│ │ │ ├── CMapFormat0.java
│ │ │ ├── CMapFormat4.java
│ │ │ ├── CMapFormat6.java
│ │ │ ├── CmapTable.java
│ │ │ ├── Glyf.java
│ │ │ ├── GlyfCompound.java
│ │ │ ├── GlyfSimple.java
│ │ │ ├── GlyfTable.java
│ │ │ ├── HeadTable.java
│ │ │ ├── HheaTable.java
│ │ │ ├── HmtxTable.java
│ │ │ ├── LocaTable.java
│ │ │ ├── MaxpTable.java
│ │ │ ├── NameTable.java
│ │ │ ├── PostTable.java
│ │ │ ├── TrueTypeFont.java
│ │ │ ├── TrueTypeTable.java
│ │ │ └── resource
│ │ │ └── glyphlist.txt
│ │ ├── function
│ │ ├── FunctionType0.java
│ │ ├── FunctionType2.java
│ │ ├── FunctionType3.java
│ │ ├── FunctionType4.java
│ │ └── PDFFunction.java
│ │ └── pattern
│ │ ├── PDFPattern.java
│ │ ├── PDFShader.java
│ │ ├── PatternType1.java
│ │ └── ShaderType2.java
└── test
│ ├── FontToy.java
│ ├── README
│ ├── TTFTest.java
│ ├── TestType1CFont.java
│ ├── Type1Decode.java
│ └── overview.html
├── swinglabs-build-impl.xml
├── tests
└── samples
│ ├── Fixed
│ ├── issue_12.pdf
│ ├── issue_14.pdf
│ ├── issue_15.pdf
│ ├── issue_17.pdf
│ ├── issue_19_a.pdf
│ ├── issue_19_b.pdf
│ ├── issue_21.pdf
│ ├── issue_26.pdf
│ ├── issue_32.pdf
│ ├── issue_37.pdf
│ ├── issue_39.pdf
│ ├── issue_48.pdf
│ ├── issue_58.pdf
│ ├── issue_61.pdf
│ ├── issue_63.pdf
│ ├── issue_64.pdf
│ ├── issue_65.pdf
│ ├── issue_8.pdf
│ └── issue_9.pdf
│ ├── HR Advert.pdf
│ ├── IntelliJIDEA8_DataSheet.pdf
│ ├── Issue_41.pdf
│ ├── KDL46V3000_om_en.pdf
│ ├── Patel
│ ├── 1.pdf
│ ├── 2.pdf
│ ├── 3.pdf
│ ├── 4.pdf
│ └── PDFRenderer_issue.doc
│ ├── Started
│ ├── issue_1.pdf
│ ├── issue_10.pdf
│ ├── issue_14.performance needed.pdf
│ ├── issue_17.pdf
│ ├── issue_1a.pdf
│ └── issue_66.pdf
│ ├── border line
│ ├── PrintPDF.java
│ ├── PrintPDF
│ │ ├── PrintPDF.jpx
│ │ ├── PrintPDF.jpx.local
│ │ ├── classes
│ │ │ ├── package cache
│ │ │ │ └── printpdf.dep2
│ │ │ └── printpdf
│ │ │ │ └── PrintPDF.class
│ │ └── src
│ │ │ └── printpdf
│ │ │ └── PrintPDF.java
│ └── Test.pdf
│ ├── ebay-renderer.png
│ ├── esppp.pdf
│ ├── forum
│ ├── 27548.music glossary.pdf
│ └── 2969..pdf
│ ├── issue63
│ ├── pdfpatch.zip
│ └── pdfpatch
│ │ ├── AdobeGlyphList.java
│ │ └── resources
│ │ └── glyphlist.txt
│ ├── issue_1.pdf
│ ├── issue_19_a.pdf
│ ├── issue_19_b.pdf
│ ├── issue_28.pdf
│ ├── issue_33.pdf
│ └── issue_44.pdf
└── tools
└── java
└── src
└── com
└── sun
└── pdfrenderer
└── tools
└── charset
├── PDFDocEncodingMap.txt
├── PDFDocEncodingMapGenerator.java
└── UnicodeData.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | *.hprof
3 |
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/Flag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: Flag.java,v 1.2 2007/12/20 18:33:33 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview;
23 |
24 | /**
25 | * A generic synchronized flag, because Java doesn't have one.
26 | */
27 | public class Flag {
28 | private boolean isSet;
29 |
30 | /**
31 | * Sets the flag. Any pending waitForFlag calls will now return.
32 | */
33 | public synchronized void set() {
34 | isSet= true;
35 | notifyAll();
36 | }
37 |
38 | /**
39 | * Clears the flag. Do this before calling waitForFlag.
40 | */
41 | public synchronized void clear() {
42 | isSet= false;
43 | }
44 |
45 | /**
46 | * Waits for the flag to be set, if it is not set already.
47 | * This method catches InterruptedExceptions, so if you want
48 | * notification of interruptions, use interruptibleWaitForFlag
49 | * instead.
50 | */
51 | public synchronized void waitForFlag() {
52 | if (!isSet) {
53 | try {
54 | wait();
55 | } catch (InterruptedException ie) {}
56 | }
57 | }
58 |
59 | /**
60 | * Waits for the flag to be set, if it is not set already.
61 | */
62 | public synchronized void interruptibleWaitForFlag()
63 | throws InterruptedException
64 | {
65 | if (!isSet) {
66 | wait();
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/PageChangeListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PageChangeListener.java,v 1.2 2007/12/20 18:33:33 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview;
23 |
24 | /**
25 | * A listener to indicate that some control has asked for a particular
26 | * page to be displayed.
27 | */
28 | public interface PageChangeListener
29 | {
30 | /**
31 | * Notifies the listener that it should go to a particular page number.
32 | */
33 | public void gotoPage(int page);
34 | }
35 |
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/first.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/first.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/fit.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/fit.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/fullscrn.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/fullscrn.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/last.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/last.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/next.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/next.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/open.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/open.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/prev.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/prev.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/print.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/print.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/zoom.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/zoom.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/zoomin.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/zoomin.gif
--------------------------------------------------------------------------------
/demos/viewer/com/sun/pdfview/gfx/zoomout.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/demos/viewer/com/sun/pdfview/gfx/zoomout.gif
--------------------------------------------------------------------------------
/doc/32000-1-2008/5176.CFF.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/32000-1-2008/5176.CFF.pdf
--------------------------------------------------------------------------------
/doc/32000-1-2008/OTGuide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/32000-1-2008/OTGuide.pdf
--------------------------------------------------------------------------------
/doc/32000-1-2008/PDF32000_2008.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/32000-1-2008/PDF32000_2008.pdf
--------------------------------------------------------------------------------
/doc/32000-1-2008/adobe_supplement_iso32000.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/32000-1-2008/adobe_supplement_iso32000.pdf
--------------------------------------------------------------------------------
/doc/5040.Download_Fonts.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/5040.Download_Fonts.pdf
--------------------------------------------------------------------------------
/doc/5121.CLUT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/5121.CLUT.pdf
--------------------------------------------------------------------------------
/doc/Apple True Type Font Reference.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=http://developer.apple.com/textfonts/TTRefMan/index.html
3 | IDList=
4 | [{000214A0-0000-0000-C000-000000000046}]
5 | Prop3=19,2
6 |
--------------------------------------------------------------------------------
/doc/CCITT.T-REC-T.4-200307-I!!PDF-E[1].pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CCITT.T-REC-T.4-200307-I!!PDF-E[1].pdf
--------------------------------------------------------------------------------
/doc/CCITT.T-REC-T.6-198811-I!!PDF-E[1].pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CCITT.T-REC-T.6-198811-I!!PDF-E[1].pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5014.CIDFont_Spec.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5014.CIDFont_Spec.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5148.SING_Tutorial.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5148.SING_Tutorial.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5149.OTFname_Tutorial.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5149.OTFname_Tutorial.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5180.sfnt.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5180.sfnt.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5640.CJK_Fonts.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5640.CJK_Fonts.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5641.CID_Embed.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5641.CID_Embed.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/5901.Kazuraki_Tutorial.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/5901.Kazuraki_Tutorial.pdf
--------------------------------------------------------------------------------
/doc/CMAP files/chinese_t.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/chinese_t.zip
--------------------------------------------------------------------------------
/doc/CMAP files/japanese.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/japanese.zip
--------------------------------------------------------------------------------
/doc/CMAP files/korean.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/korean.zip
--------------------------------------------------------------------------------
/doc/CMAP files/otf_jis2004.tar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/CMAP files/otf_jis2004.tar
--------------------------------------------------------------------------------
/doc/ICC1v42_2006-05.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/ICC1v42_2006-05.pdf
--------------------------------------------------------------------------------
/doc/PDFlib-tutorial.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/PDFlib-tutorial.pdf
--------------------------------------------------------------------------------
/doc/PostscriptLanguageReferenceManual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/PostscriptLanguageReferenceManual.pdf
--------------------------------------------------------------------------------
/doc/TN5603.Filters.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/TN5603.Filters.pdf
--------------------------------------------------------------------------------
/doc/opentypeSpec.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec.zip
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/5176.CFF.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/5176.CFF.pdf
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/5177.Type2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/5177.Type2.pdf
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00269.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00269.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00270.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00270.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00271.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00271.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00272.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00272.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00273.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00273.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00274.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00274.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00275.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00275.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00276.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00276.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00277.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00277.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00278.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00278.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00279.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00279.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00280.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00280.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00281.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00281.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00282.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00282.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00286.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00286.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00287.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00287.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00288.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00288.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00289.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00289.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00290.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00290.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00291.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00291.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00292.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00292.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00293.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00293.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00294.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00294.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00295.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00295.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00296.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00296.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00297.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00297.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00298.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00298.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00299.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00299.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00300.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00300.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00301.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00301.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00302.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00302.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00303.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00303.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00304.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00304.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00305.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00305.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00306.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00306.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00307.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00307.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00308.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00308.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00309.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00309.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00310.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00310.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00311.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00311.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00312.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00312.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/IMG00313.GIF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/IMG00313.GIF
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/Img000283.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/Img000283.gif
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/Img00283.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/Img00283.gif
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/Img00284.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/Img00284.gif
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/Img00285.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/Img00285.gif
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/Img00302b.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/Img00302b.gif
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/Thumbs.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/doc/opentypeSpec/Typography/otspec/Thumbs.db
--------------------------------------------------------------------------------
/doc/opentypeSpec/Typography/otspec/about.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 | ");
71 | System.exit(-1);
72 | }
73 |
74 | try {
75 | RandomAccessFile raf = new RandomAccessFile(args[0], "r");
76 |
77 | int size = (int) raf.length();
78 | byte[] data = new byte[size];
79 |
80 | raf.readFully(data);
81 | printData(data);
82 | } catch (IOException ioe) {
83 | ioe.printStackTrace();
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/Identity8BitCharsetEncoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Pirion Systems Pty Ltd, 139 Warry St,
3 | * Fortitude Valley, Queensland, Australia
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | package com.sun.pdfview;
21 |
22 | import com.sun.pdfview.PDFStringUtil;
23 |
24 | import java.nio.charset.CharsetEncoder;
25 | import java.nio.charset.CoderResult;
26 | import java.nio.charset.Charset;
27 | import java.nio.CharBuffer;
28 | import java.nio.ByteBuffer;
29 | import java.util.Map;
30 | import java.util.HashMap;
31 |
32 | /**
33 | * A {@link CharsetEncoder} that attempts to write out the lower 8 bits
34 | * of any character. Characters >= 256 in value are regarded
35 | * as unmappable.
36 | *
37 | * @author Luke Kirby
38 | */
39 | public class Identity8BitCharsetEncoder extends CharsetEncoder {
40 |
41 | public Identity8BitCharsetEncoder() {
42 | super(null, 1, 1);
43 | }
44 |
45 | protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
46 | while (in.remaining() > 0) {
47 | if (out.remaining() < 1) {
48 | return CoderResult.OVERFLOW;
49 | }
50 | final char c = in.get();
51 | if (c >= 0 && c < 256) {
52 | out.put((byte) c);
53 | } else {
54 | return CoderResult.unmappableForLength(1);
55 | }
56 | }
57 | return CoderResult.UNDERFLOW;
58 | }
59 |
60 | @Override
61 | public boolean isLegalReplacement(byte[] repl) {
62 | // avoid referencing the non-existent character set
63 | return true;
64 | }
65 | }
--------------------------------------------------------------------------------
/src/com/sun/pdfview/ImageInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: ImageInfo.java,v 1.3 2009/01/16 16:26:11 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import java.awt.geom.Rectangle2D;
24 | import java.awt.Color;
25 |
26 | public class ImageInfo {
27 |
28 | int width;
29 | int height;
30 | Rectangle2D clip;
31 | Color bgColor;
32 |
33 | public ImageInfo(int width, int height, Rectangle2D clip) {
34 | this(width, height, clip, Color.WHITE);
35 | }
36 |
37 | public ImageInfo(int width, int height, Rectangle2D clip, Color bgColor) {
38 | this.width = width;
39 | this.height = height;
40 | this.clip = clip;
41 | this.bgColor = bgColor;
42 | }
43 |
44 | // a hashcode that uses width, height and clip to generate its number
45 | @Override
46 | public int hashCode() {
47 | int code = (width ^ height << 16);
48 |
49 | if (clip != null) {
50 | code ^= ((int) clip.getWidth() | (int) clip.getHeight()) << 8;
51 | code ^= ((int) clip.getMinX() | (int) clip.getMinY());
52 | }
53 |
54 | return code;
55 | }
56 |
57 | // an equals method that compares values
58 | @Override
59 | public boolean equals(Object o) {
60 | if (!(o instanceof ImageInfo)) {
61 | return false;
62 | }
63 |
64 | ImageInfo ii = (ImageInfo) o;
65 |
66 | if (width != ii.width || height != ii.height) {
67 | return false;
68 | } else if (clip != null && ii.clip != null) {
69 | return clip.equals(ii.clip);
70 | } else if (clip == null && ii.clip == null) {
71 | return true;
72 | } else {
73 | return false;
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/OutlineNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: OutlineNode.java,v 1.3 2009/01/16 16:26:10 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import javax.swing.tree.DefaultMutableTreeNode;
24 |
25 | import com.sun.pdfview.action.PDFAction;
26 |
27 | public class OutlineNode extends DefaultMutableTreeNode {
28 | // the name of this node
29 |
30 | private String title;
31 |
32 | /**
33 | * Create a new outline node
34 | *
35 | * @param title the node's visible name in the tree
36 | */
37 | public OutlineNode(String title) {
38 | this.title = title;
39 | }
40 |
41 | /**
42 | * Get the PDF action associated with this node
43 | */
44 | public PDFAction getAction() {
45 | return (PDFAction) getUserObject();
46 | }
47 |
48 | /**
49 | * Set the PDF action associated with this node
50 | */
51 | public void setAction(PDFAction action) {
52 | setUserObject(action);
53 | }
54 |
55 | /**
56 | * Return the node's visible name in the tree
57 | */
58 | @Override
59 | public String toString() {
60 | return title;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/PDFCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFCmd.java,v 1.3 2009/01/16 16:26:13 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import java.awt.geom.Rectangle2D;
24 |
25 | /**
26 | * The abstract superclass of all drawing commands for a PDFPage.
27 | * @author Mike Wessler
28 | */
29 | public abstract class PDFCmd {
30 |
31 | /**
32 | * mark the page or change the graphics state
33 | * @param state the current graphics state; may be modified during
34 | * execution.
35 | * @return the region of the page made dirty by executing this command
36 | * or null if no region was touched. Note this value should be
37 | * in the coordinates of the image touched, not the page.
38 | */
39 | public abstract Rectangle2D execute(PDFRenderer state);
40 |
41 | /**
42 | * a human readable representation of this command
43 | */
44 | @Override
45 | public String toString() {
46 | String name = getClass().getName();
47 | int lastDot = name.lastIndexOf('.');
48 | if (lastDot >= 0) {
49 | return name.substring(lastDot + 1);
50 | } else {
51 | return name;
52 | }
53 | }
54 |
55 | /**
56 | * the details of this command
57 | */
58 | public String getDetails() {
59 | return super.toString();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/PDFPaint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFPaint.java,v 1.4 2009/01/16 16:26:09 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import java.awt.Color;
24 | import java.awt.Graphics2D;
25 | import java.awt.Paint;
26 | import java.awt.geom.GeneralPath;
27 | import java.awt.geom.Rectangle2D;
28 |
29 | /**
30 | * PDFPaint is some kind of shader that knows how to fill a path.
31 | * At the moment, only a solid color is implemented, but gradients
32 | * and textures should be possible, too.
33 | * @author Mike Wessler
34 | */
35 | public class PDFPaint {
36 |
37 | private Paint mainPaint;
38 |
39 | /**
40 | * create a new PDFPaint based on a solid color
41 | */
42 | protected PDFPaint(Paint p) {
43 | this.mainPaint = p;
44 | }
45 |
46 | /**
47 | * get the PDFPaint representing a solid color
48 | */
49 | public static PDFPaint getColorPaint(Color c) {
50 | return getPaint(c);
51 | }
52 |
53 | /**
54 | * get the PDFPaint representing a generic paint
55 | */
56 | public static PDFPaint getPaint(Paint p) {
57 | return new PDFPaint(p);
58 | }
59 |
60 | /**
61 | * fill a path with the paint, and record the dirty area.
62 | * @param state the current graphics state
63 | * @param g the graphics into which to draw
64 | * @param s the path to fill
65 | */
66 | public Rectangle2D fill(PDFRenderer state, Graphics2D g,
67 | GeneralPath s) {
68 | g.setPaint(mainPaint);
69 | g.fill(s);
70 |
71 | return s.createTransformedShape(g.getTransform()).getBounds2D();
72 | }
73 |
74 | /**
75 | * get the primary color associated with this PDFPaint.
76 | */
77 | public Paint getPaint() {
78 | return mainPaint;
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/PDFParseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFParseException.java,v 1.4 2009/03/12 12:25:25 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import java.io.IOException;
24 |
25 | /**
26 | * an exception class for recording parse errors in the PDF file
27 | * @author Mike Wessler
28 | */
29 | public class PDFParseException extends IOException {
30 |
31 | public PDFParseException(String msg) {
32 | super(msg);
33 | }
34 |
35 | public PDFParseException(String msg, Throwable cause) {
36 | this(msg);
37 | initCause(cause);
38 | }
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/PDFXref.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFXref.java,v 1.4 2009/02/12 13:53:56 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import java.lang.ref.SoftReference;
24 |
25 | /**
26 | * a cross reference representing a line in the PDF cross referencing
27 | * table.
28 | *
29 | * There are two forms of the PDFXref, destinguished by absolutely nothing.
30 | * The first type of PDFXref is used as indirect references in a PDFObject.
31 | * In this type, the id is an index number into the object cross reference
32 | * table. The id will range from 0 to the size of the cross reference
33 | * table.
34 | *
35 | * The second form is used in the Java representation of the cross reference
36 | * table. In this form, the id is the file position of the start of the
37 | * object in the PDF file. See the use of both of these in the
38 | * PDFFile.dereference() method, which takes a PDFXref of the first form,
39 | * and uses (internally) a PDFXref of the second form.
40 | *
41 | * This is an unhappy state of affairs, and should be fixed. Fortunatly,
42 | * the two uses have already been factored out as two different methods.
43 | *
44 | * @author Mike Wessler
45 | */
46 | public class PDFXref {
47 |
48 | private int id;
49 | private int generation;
50 | // this field is only used in PDFFile.objIdx
51 | private SoftReference reference = null;
52 |
53 | /**
54 | * create a new PDFXref, given a parsed id and generation.
55 | */
56 | public PDFXref(int id, int gen) {
57 | this.id = id;
58 | this.generation = gen;
59 | }
60 |
61 | /**
62 | * create a new PDFXref, given a sequence of bytes representing the
63 | * fixed-width cross reference table line
64 | */
65 | public PDFXref(byte[] line) {
66 | if (line == null) {
67 | id = -1;
68 | generation = -1;
69 | } else {
70 | id = Integer.parseInt(new String(line, 0, 10));
71 | generation = Integer.parseInt(new String(line, 11, 5));
72 | }
73 | }
74 |
75 | /**
76 | * get the character index into the file of the start of this object
77 | */
78 | public int getFilePos() {
79 | return id;
80 | }
81 |
82 | /**
83 | * get the generation of this object
84 | */
85 | public int getGeneration() {
86 | return generation;
87 | }
88 |
89 | /**
90 | * get the object number of this object
91 | */
92 | public int getID() {
93 | return id;
94 | }
95 |
96 | /**
97 | * Get the object this reference refers to, or null if it hasn't been
98 | * set.
99 | * @return the object if it exists, or null if not
100 | */
101 | public PDFObject getObject() {
102 | if (reference != null) {
103 | return (PDFObject) reference.get();
104 | }
105 |
106 | return null;
107 | }
108 |
109 | /**
110 | * Set the object this reference refers to.
111 | */
112 | public void setObject(PDFObject obj) {
113 | this.reference = new SoftReference(obj);
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/RefImage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: RefImage.java,v 1.3 2009/01/16 16:26:10 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | import java.awt.Graphics2D;
24 | import java.awt.image.BufferedImage;
25 |
26 | /**
27 | * A BufferedImage subclass that holds a strong reference to its graphics
28 | * object. This means that the graphics will never go away as long as
29 | * someone holds a reference to this image, and createGraphics() and
30 | * getGraphics() can be called multiple times safely, and will always return
31 | * the same graphics object.
32 | */
33 | public class RefImage extends BufferedImage {
34 |
35 | /** a strong reference to the graphics object */
36 | private Graphics2D g;
37 |
38 | /** Creates a new instance of RefImage */
39 | public RefImage(int width, int height, int type) {
40 | super(width, height, type);
41 | }
42 |
43 | /**
44 | * Create a graphics object only if it is currently null, otherwise
45 | * return the existing graphics object.
46 | */
47 | public Graphics2D createGraphics() {
48 | if (g == null) {
49 | g = super.createGraphics();
50 | }
51 |
52 | return g;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/Watchable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: Watchable.java,v 1.3 2009/01/16 16:26:15 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview;
22 |
23 | /**
24 | * An interface for rendering or parsing, which can be stopped and started.
25 | */
26 | public interface Watchable {
27 |
28 | /** the possible statuses */
29 | public static final int UNKNOWN = 0;
30 | public static final int NOT_STARTED = 1;
31 | public static final int PAUSED = 2;
32 | public static final int NEEDS_DATA = 3;
33 | public static final int RUNNING = 4;
34 | public static final int STOPPED = 5;
35 | public static final int COMPLETED = 6;
36 | public static final int ERROR = 7;
37 |
38 | /**
39 | * Get the status of this watchable
40 | *
41 | * @return one of the well-known statuses
42 | */
43 | public int getStatus();
44 |
45 | /**
46 | * Stop this watchable. Stop will cause all processing to cease,
47 | * and the watchable to be destroyed.
48 | */
49 | public void stop();
50 |
51 | /**
52 | * Start this watchable and run until it is finished or stopped.
53 | * Note the watchable may be stopped if go() with a
54 | * different time is called during execution.
55 | */
56 | public void go();
57 |
58 | /**
59 | * Start this watchable and run for the given number of steps or until
60 | * finished or stopped.
61 | *
62 | * @param steps the number of steps to run for
63 | */
64 | public void go(int steps);
65 |
66 | /**
67 | * Start this watchable and run for the given amount of time, or until
68 | * finished or stopped.
69 | *
70 | * @param millis the number of milliseconds to run for
71 | */
72 | public void go(long millis);
73 | }
74 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/action/GoToAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: GoToAction.java,v 1.2 2007/12/20 18:33:34 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.action;
23 |
24 | import java.io.IOException;
25 |
26 | import com.sun.pdfview.PDFObject;
27 | import com.sun.pdfview.PDFDestination;
28 | import com.sun.pdfview.PDFParseException;
29 |
30 | /**
31 | * An action which specifies going to a particular destination
32 | */
33 | public class GoToAction extends PDFAction {
34 | /** the destination to go to */
35 | private PDFDestination dest;
36 |
37 | /**
38 | * Creates a new instance of GoToAction from an object
39 | *
40 | * @param obj the PDFObject with the action information
41 | */
42 | public GoToAction(PDFObject obj, PDFObject root) throws IOException {
43 | super("GoTo");
44 |
45 | // find the destination
46 | PDFObject destObj = obj.getDictRef("D");
47 | if (destObj == null) {
48 | throw new PDFParseException("No destination in GoTo action " + obj);
49 | }
50 |
51 | // parse it
52 | dest = PDFDestination.getDestination(destObj, root);
53 | }
54 |
55 | /**
56 | * Create a new GoToAction from a destination
57 | */
58 | public GoToAction(PDFDestination dest) {
59 | super("GoTo");
60 |
61 | this.dest = dest;
62 | }
63 |
64 | /**
65 | * Get the destination this action refers to
66 | */
67 | public PDFDestination getDestination() {
68 | return dest;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/action/PDFAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFAction.java,v 1.2 2007/12/20 18:33:34 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.action;
23 |
24 | import java.io.IOException;
25 |
26 | import com.sun.pdfview.PDFObject;
27 | import com.sun.pdfview.PDFParseException;
28 |
29 | /**
30 | * The common super-class of all PDF actions.
31 | */
32 | public class PDFAction {
33 | /** the type of this action */
34 | private String type;
35 |
36 | /** the next action or array of actions */
37 | private PDFObject next;
38 |
39 | /** Creates a new instance of PDFAction */
40 | public PDFAction(String type) {
41 | this.type = type;
42 | }
43 |
44 | /**
45 | * Get an action of the appropriate type from a PDFObject
46 | *
47 | * @param obj the PDF object containing the action to parse
48 | * @param root the root of the PDF object tree
49 | */
50 | public static PDFAction getAction(PDFObject obj, PDFObject root)
51 | throws IOException
52 | {
53 | // figure out the action type
54 | PDFObject typeObj = obj.getDictRef("S");
55 | if (typeObj == null) {
56 | throw new PDFParseException("No action type in object: " + obj);
57 | }
58 |
59 | // create the action based on the type
60 | PDFAction action = null;
61 | String type = typeObj.getStringValue();
62 | if (type.equals("GoTo")) {
63 | action = new GoToAction(obj, root);
64 | } else {
65 | /** [JK FIXME: Implement other action types! ] */
66 | throw new PDFParseException("Unknown Action type: " + type);
67 | }
68 |
69 | // figure out if there is a next action
70 | PDFObject nextObj = obj.getDictRef("Next");
71 | if (nextObj != null) {
72 | action.setNext(nextObj);
73 | }
74 |
75 | // return the action
76 | return action;
77 | }
78 |
79 | /**
80 | * Get the type of this action
81 | */
82 | public String getType() {
83 | return type;
84 | }
85 |
86 | /**
87 | * Get the next action or array of actions
88 | */
89 | public PDFObject getNext() {
90 | return next;
91 | }
92 |
93 | /**
94 | * Set the next action or array of actions
95 | */
96 | public void setNext(PDFObject next) {
97 | this.next = next;
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/colorspace/AlternateColorSpace.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: AlternateColorSpace.java,v 1.2 2007/12/20 18:33:34 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.colorspace;
23 |
24 | import java.awt.color.ColorSpace;
25 |
26 | import com.sun.pdfview.PDFPaint;
27 | import com.sun.pdfview.function.PDFFunction;
28 |
29 | /**
30 | * A color space that uses another color space to return values, and a
31 | * function to map between values in the input and input values to the
32 | * alternate color space
33 | */
34 | public class AlternateColorSpace extends PDFColorSpace {
35 | /** The alternate color space */
36 | private PDFColorSpace alternate;
37 |
38 | /** The function */
39 | private PDFFunction function;
40 |
41 | /** Creates a new instance of AlternateColorSpace */
42 | public AlternateColorSpace(PDFColorSpace alternate, PDFFunction function) {
43 | super(null);
44 |
45 | this.alternate = alternate;
46 | this.function = function;
47 | }
48 |
49 | /**
50 | * get the number of components expected in the getPaint command
51 | */
52 | @Override public int getNumComponents() {
53 | if (function != null) {
54 | return function.getNumInputs();
55 | } else {
56 | return alternate.getNumComponents();
57 | }
58 | }
59 |
60 | /**
61 | * get the PDFPaint representing the color described by the
62 | * given color components
63 | * @param components the color components corresponding to the given
64 | * colorspace
65 | * @return a PDFPaint object representing the closest Color to the
66 | * given components.
67 | */
68 | @Override public PDFPaint getPaint(float[] components) {
69 | if (function != null) {
70 | // translate values using function
71 | components = function.calculate(components);
72 | }
73 |
74 | return alternate.getPaint(components);
75 | }
76 |
77 | /**
78 | * get the original Java ColorSpace.
79 | */
80 | @Override public ColorSpace getColorSpace() {
81 | return alternate.getColorSpace();
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/colorspace/CMYKColorSpace.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: CMYKColorSpace.java,v 1.2 2007/12/20 18:33:34 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.colorspace;
23 |
24 | import java.awt.color.ColorSpace;
25 |
26 | /**
27 | * A ColorSpace for the CMYK color space.
28 | *
29 | * @author Mike Wessler
30 | */
31 | public class CMYKColorSpace extends ColorSpace {
32 | /**
33 | * create a new CMYK color space: a ColorSpace with 4 components
34 | */
35 | public CMYKColorSpace() {
36 | super(TYPE_CMYK, 4);
37 | }
38 |
39 | /**
40 | * Convert from CIEXYZ to RGB. NOT IMPLEMENTED
41 | */
42 | public float[] fromCIEXYZ(float[] colorvalue) {
43 | return new float[3];
44 | }
45 |
46 | /**
47 | * Convert from RGB to CMYK.
48 | * @param rgbvalue the red, green, and blue values (0-1)
49 | * @return the CMYK values (0-1)
50 | */
51 | public float[] fromRGB(float[] rgbvalue) {
52 | float color[]= new float[4];
53 | float c= 1-rgbvalue[0];
54 | float m= 1-rgbvalue[1];
55 | float y= 1-rgbvalue[2];
56 | float k= Math.min(c, Math.min(m, y));
57 | float ik= 1-k;
58 | if (ik==0) {
59 | c= 1;
60 | m= 1;
61 | y= 1;
62 | } else {
63 | c= (c-k)/ik;
64 | m= (m-k)/ik;
65 | y= (y-k)/ik;
66 | }
67 | color[0]= c;
68 | color[1]= m;
69 | color[2]= y;
70 | color[3]= k;
71 | return color;
72 | }
73 |
74 | /**
75 | * the number of components
76 | */
77 | @Override public int getNumComponents() {
78 | return 4;
79 | }
80 |
81 | /**
82 | * the name of this color space
83 | */
84 | @Override public String getName(int idx) {
85 | return "CMYK";
86 | }
87 |
88 | /**
89 | * the type of this color space (TYPE_CMYK)
90 | */
91 | @Override public int getType() {
92 | return TYPE_CMYK;
93 | }
94 |
95 | /**
96 | * Convert from CMYK to CIEXYZ. NOT IMPLEMENTED
97 | */
98 | public float[] toCIEXYZ(float[] colorvalue) {
99 | return new float[3];
100 | }
101 |
102 | /**
103 | * Convert from CMYK to RGB.
104 | * @param colorvalue the CMYK values (0-1)
105 | * @return the RGB values (0-1)
106 | */
107 | public float[] toRGB(float[] colorvalue) {
108 | if (colorvalue.length==4) {
109 | float[] color= new float[3];
110 | float k= colorvalue[3];
111 | float ik= 1-k;
112 | color[0]= (1-(colorvalue[0]*ik+k));
113 | color[1]= (1-(colorvalue[1]*ik+k));
114 | color[2]= (1-(colorvalue[2]*ik+k));
115 | return color;
116 | } else {
117 | return new float[3];
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/colorspace/MaskColorSpace.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: MaskColorSpace.java,v 1.3 2007/12/20 18:33:34 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.colorspace;
23 |
24 | import java.awt.Color;
25 | import java.awt.color.ColorSpace;
26 |
27 | import com.sun.pdfview.PDFPaint;
28 |
29 | /**
30 | * A color space used to implement masks. For now, the only type of mask
31 | * supported is one where the image pixels specify where to paint, and the
32 | * painting itself is done in a pre-specified PDF Paint.
33 | */
34 | public class MaskColorSpace extends ColorSpace {
35 | /** The paint to paint in. Note this cannot be a pattern or gradient. */
36 | private PDFPaint paint;
37 |
38 | /** Creates a new instance of PaintColorSpace */
39 | public MaskColorSpace(PDFPaint paint) {
40 | super (TYPE_RGB, 1);
41 |
42 | this.paint = paint;
43 | }
44 |
45 | public float[] fromCIEXYZ(float[] colorvalue) {
46 | float x = colorvalue[0];
47 | float y = colorvalue[1];
48 | float z = colorvalue[2];
49 |
50 | float[] mask = new float[1];
51 |
52 | if (Math.round(x) > 0 || Math.round(y) > 0 || Math.round(z) > 0) {
53 | mask[0] = 1;
54 | } else {
55 | mask[0] = 0;
56 | }
57 |
58 | return mask;
59 | }
60 |
61 | public float[] fromRGB(float[] rgbvalue) {
62 | float r = rgbvalue[0];
63 | float g = rgbvalue[1];
64 | float b = rgbvalue[2];
65 |
66 | float[] mask = new float[1];
67 |
68 | if (Math.round(r) > 0 || Math.round(g) > 0 || Math.round(b) > 0) {
69 | mask[0] = 1;
70 | } else {
71 | mask[0] = 0;
72 | }
73 |
74 | return mask;
75 | }
76 |
77 | ColorSpace cie = ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
78 | float[] prev1= cie.fromRGB(toRGB(new float[] {1.0f}));
79 | float[] prev0= cie.fromRGB(toRGB(new float[] {0.0f}));
80 |
81 | public float[] toCIEXYZ(float[] colorvalue) {
82 | if (colorvalue[0]==1) {
83 | return prev1;
84 | } else if (colorvalue[0]==0) {
85 | return prev0;
86 | } else {
87 | // System.out.println("MaskColorSpace converting: "+colorvalue[0]);
88 | return cie.fromRGB(toRGB(colorvalue));
89 | }
90 | }
91 |
92 | public float[] toRGB(float[] colorvalue) {
93 | return ((Color) paint.getPaint()).getRGBColorComponents(null);
94 | }
95 |
96 | @Override public int getNumComponents() {
97 | return 1;
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/colorspace/PatternSpace.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PatternSpace.java,v 1.2 2007/12/20 18:33:34 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.colorspace;
23 |
24 | import java.io.IOException;
25 | import java.util.Map;
26 |
27 | import com.sun.pdfview.PDFObject;
28 | import com.sun.pdfview.PDFPaint;
29 | import com.sun.pdfview.pattern.PDFPattern;
30 |
31 | /**
32 | * A PatternSpace fills with a pattern, the name of which is
33 | * specified in the call to getPaint(). This pattern is
34 | * read from the resources of the current page. The pattern space
35 | * may also have a base color space which the pattern is defined in.
36 | */
37 | public class PatternSpace extends PDFColorSpace {
38 | private PDFColorSpace base;
39 |
40 | public PatternSpace() {
41 | super(null);
42 | }
43 |
44 | /**
45 | * Create a pattern space with the given color space as a base
46 | */
47 | public PatternSpace(PDFColorSpace base) {
48 | super(null);
49 |
50 | this.base = base;
51 | }
52 |
53 | /**
54 | * Get the base color space
55 | */
56 | public PDFColorSpace getBase() {
57 | return base;
58 | }
59 |
60 | /**
61 | * Get the number of components we want
62 | */
63 | @Override public int getNumComponents() {
64 | if (base == null) {
65 | return 0;
66 | } else {
67 | return base.getNumComponents();
68 | }
69 | }
70 |
71 | /**
72 | * get the PDFPaint representing the color described by the
73 | * given color components
74 | * @param components the color components corresponding to the given
75 | * colorspace
76 | * @return a PDFPaint object representing the closest Color to the
77 | * given components.
78 | */
79 | @Override public PDFPaint getPaint(float[] components) {
80 | throw new IllegalArgumentException("Pattern spaces require a pattern " +
81 | "name!");
82 | }
83 |
84 | /**
85 | * Get the paint representing a pattern, optionally with the given
86 | * base paint.
87 | *
88 | * @param patternObj the pattern to render
89 | * @param components the components of the base paint
90 | */
91 | public PDFPaint getPaint(PDFObject patternObj, float[] components,
92 | Map resources)
93 | throws IOException
94 | {
95 | PDFPaint basePaint = null;
96 |
97 | if (getBase() != null) {
98 | basePaint = getBase().getPaint(components);
99 | }
100 |
101 | PDFPattern pattern = (PDFPattern) patternObj.getCache();
102 | if (pattern == null) {
103 | pattern = PDFPattern.getPattern(patternObj, resources);
104 | patternObj.setCache(pattern);
105 | }
106 |
107 | return pattern.getPaint(basePaint);
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/colorspace/sGray.icc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/colorspace/sGray.icc
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decode/CCITTFaxDecode.java:
--------------------------------------------------------------------------------
1 | package com.sun.pdfview.decode;
2 |
3 | import java.io.IOException;
4 | import java.nio.ByteBuffer;
5 |
6 | import com.sun.pdfview.PDFObject;
7 |
8 | public class CCITTFaxDecode {
9 |
10 |
11 |
12 | protected static ByteBuffer decode(PDFObject dict, ByteBuffer buf,
13 | PDFObject params) throws IOException {
14 |
15 | byte[] bytes = new byte[buf.remaining()];
16 | buf.get(bytes, 0, bytes.length);
17 | return ByteBuffer.wrap(decode(dict, bytes));
18 | }
19 |
20 |
21 | protected static byte[] decode(PDFObject dict, byte[] source) throws IOException {
22 | int width = 1728;
23 | PDFObject widthDef = dict.getDictRef("Width");
24 | if (widthDef == null) {
25 | widthDef = dict.getDictRef("W");
26 | }
27 | if (widthDef != null) {
28 | width = widthDef.getIntValue();
29 | }
30 | int height = 0;
31 | PDFObject heightDef = dict.getDictRef("Height");
32 | if (heightDef == null) {
33 | heightDef = dict.getDictRef("H");
34 | }
35 | if (heightDef != null) {
36 | height = heightDef.getIntValue();
37 | }
38 |
39 | //
40 | int columns = getOptionFieldInt(dict, "Columns", width);
41 | int rows = getOptionFieldInt(dict, "Rows", height);
42 | int k = getOptionFieldInt(dict, "K", 0);
43 | int size = rows * ((columns + 7) >> 3);
44 | byte[] destination = new byte[size];
45 |
46 | boolean align = getOptionFieldBoolean(dict, "EncodedByteAlign", false);
47 |
48 | CCITTFaxDecoder decoder = new CCITTFaxDecoder(1, columns, rows);
49 | decoder.setAlign(align);
50 | if (k == 0) {
51 | decoder.decodeT41D(destination, source, 0, rows);
52 | } else if (k > 0) {
53 | decoder.decodeT42D(destination, source, 0, rows);
54 | } else if (k < 0) {
55 | decoder.decodeT6(destination, source, 0, rows);
56 | }
57 | if (!getOptionFieldBoolean(dict, "BlackIs1", false)) {
58 | for (int i = 0; i < destination.length; i++) {
59 | // bitwise not
60 | destination[i] = (byte) ~destination[i];
61 | }
62 | }
63 |
64 | return destination;
65 | }
66 |
67 | public static int getOptionFieldInt(PDFObject dict, String name, int defaultValue) throws IOException {
68 |
69 | PDFObject dictParams = dict.getDictRef("DecodeParms");
70 |
71 | if (dictParams == null) {
72 | return defaultValue;
73 | }
74 | PDFObject value = dictParams.getDictRef(name);
75 | if (value == null) {
76 | return defaultValue;
77 | }
78 | return value.getIntValue();
79 | }
80 |
81 | public static boolean getOptionFieldBoolean(PDFObject dict, String name, boolean defaultValue) throws IOException {
82 |
83 | PDFObject dictParams = dict.getDictRef("DecodeParms");
84 |
85 | if (dictParams == null) {
86 | return defaultValue;
87 | }
88 | PDFObject value = dictParams.getDictRef(name);
89 | if (value == null) {
90 | return defaultValue;
91 | }
92 | return value.getBooleanValue();
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decode/RunLengthDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: RunLengthDecode.java,v 1.1 2009/02/21 20:04:52 tomoke Exp $
3 | *
4 | * Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview.decode;
22 |
23 | import java.io.ByteArrayOutputStream;
24 | import java.nio.ByteBuffer;
25 |
26 | import com.sun.pdfview.PDFObject;
27 | import com.sun.pdfview.PDFParseException;
28 |
29 | /**
30 | * decode an array of Run Length encoded bytes into a byte array
31 | *
32 | * @author Mike Wessler
33 | */
34 | public class RunLengthDecode {
35 | /** the end of data in the RunLength encoding. */
36 | private static final int RUN_LENGTH_EOD = 128;
37 |
38 | private ByteBuffer buf;
39 |
40 | /**
41 | * initialize the decoder with an array of bytes in RunLength format
42 | */
43 | private RunLengthDecode(ByteBuffer buf) {
44 | this.buf = buf;
45 | }
46 |
47 | /**
48 | * decode the array
49 | * @return the decoded bytes
50 | */
51 | private ByteBuffer decode() throws PDFParseException {
52 | // start at the beginning of the buffer
53 | buf.rewind();
54 |
55 | // allocate the output buffer
56 | ByteArrayOutputStream baos = new ByteArrayOutputStream();
57 | byte dupAmount = -1;
58 | byte[] buffer = new byte[128];
59 | while ((dupAmount = buf.get()) != -1 &&
60 | dupAmount != RUN_LENGTH_EOD) {
61 | if (dupAmount <= 127) {
62 | int amountToCopy = dupAmount + 1;
63 | while (amountToCopy > 0) {
64 | buf.get(buffer, 0, amountToCopy);
65 | baos.write(buffer, 0, amountToCopy);
66 | }
67 | } else {
68 | byte dupByte = buf.get();
69 | for (int i = 0; i < 257 - (int) (dupAmount & 0xFF); i++) {
70 | baos.write(dupByte);
71 | }
72 | }
73 | }
74 | return ByteBuffer.wrap(baos.toByteArray());
75 | }
76 |
77 | /**
78 | * decode an array of bytes in RunLength format.
79 | *
80 | * RunLength format consists of a sequence of a byte-oriented format
81 | * based on run length. There are a series of "runs", where
82 | * a run is a length byte followed by 1 to 128 bytes of data.
83 | * If the length is 0-127, the following length+1 (1 to 128) bytes are
84 | * to be copied. If the length is 129 through 255, the following
85 | * single byte is copied 257-length (2 to 128) times.
86 | * A length value of 128 means and End of Data (EOD).
87 | *
88 | * @param buf the RUnLEngth encoded bytes in a byte buffer
89 | *
90 | * @param params parameters to the decoder (ignored)
91 | * @return the decoded bytes
92 | */
93 | public static ByteBuffer decode(ByteBuffer buf, PDFObject params)
94 | throws PDFParseException {
95 | RunLengthDecode me = new RunLengthDecode(buf);
96 | return me.decode();
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decrypt/EncryptionUnsupportedByPlatformException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Pirion Systems Pty Ltd, 139 Warry St,
3 | * Fortitude Valley, Queensland, Australia
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | package com.sun.pdfview.decrypt;
21 |
22 | /**
23 | * Identifies that the specified encryption mechanism, though supported by the
24 | * product, is not supported by the platform that it is running on; i.e., that
25 | * either the JCE does not support a required cipher or that its policy is
26 | * such that a key of a given length can not be used.
27 | *
28 | * @author Luke Kirby
29 | */
30 | public class EncryptionUnsupportedByPlatformException
31 | extends UnsupportedEncryptionException {
32 |
33 | public EncryptionUnsupportedByPlatformException(String message) {
34 | super(message);
35 | }
36 |
37 | public EncryptionUnsupportedByPlatformException(String message, Throwable cause) {
38 | super(message, cause);
39 | }
40 | }
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decrypt/EncryptionUnsupportedByProductException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Pirion Systems Pty Ltd, 139 Warry St,
3 | * Fortitude Valley, Queensland, Australia
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | package com.sun.pdfview.decrypt;
21 |
22 | /**
23 | * Identifies that the specified encryption mechanism is not
24 | * supported by this product, that is, PDFRenderer, as opposed to
25 | * a {@link EncryptionUnsupportedByPlatformException limitation in
26 | * the platform}.
27 | *
28 | * @author Luke Kirby
29 | */
30 | public class EncryptionUnsupportedByProductException
31 | extends UnsupportedEncryptionException {
32 |
33 | public EncryptionUnsupportedByProductException(String message) {
34 | super(message);
35 | }
36 | }
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decrypt/IdentityDecrypter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Pirion Systems Pty Ltd, 139 Warry St,
3 | * Fortitude Valley, Queensland, Australia
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | package com.sun.pdfview.decrypt;
21 |
22 | import com.sun.pdfview.PDFObject;
23 | import com.sun.pdfview.PDFParseException;
24 |
25 | import java.nio.ByteBuffer;
26 |
27 | /**
28 | * Performs identity decryption; that is, inputs aren't encrypted and
29 | * are returned right back.
30 | *
31 | * @Author Luke Kirby
32 | */
33 | public class IdentityDecrypter implements PDFDecrypter {
34 |
35 | private static IdentityDecrypter INSTANCE = new IdentityDecrypter();
36 |
37 | public ByteBuffer decryptBuffer(String cryptFilterName,
38 | PDFObject streamObj, ByteBuffer streamBuf)
39 | throws PDFParseException {
40 |
41 | if (cryptFilterName != null) {
42 | throw new PDFParseException("This Encryption version does not support Crypt filters");
43 | }
44 |
45 | return streamBuf;
46 | }
47 |
48 | public String decryptString(int objNum, int objGen, String inputBasicString) {
49 | return inputBasicString;
50 | }
51 |
52 | public static IdentityDecrypter getInstance() {
53 | return INSTANCE;
54 | }
55 |
56 | public boolean isEncryptionPresent() {
57 | return false;
58 | }
59 |
60 | public boolean isOwnerAuthorised() {
61 | return false;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decrypt/PDFAuthenticationFailureException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Pirion Systems Pty Ltd, 139 Warry St,
3 | * Fortitude Valley, Queensland, Australia
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | package com.sun.pdfview.decrypt;
21 |
22 | import com.sun.pdfview.PDFParseException;
23 |
24 | /**
25 | * Identifies that the supplied password was incorrect or non-existent
26 | * and required.
27 | * @author Luke Kirby
28 | */
29 | // TODO - consider having this not extend PDFParseException so that
30 | // it will be handled more explicitly?
31 | public class PDFAuthenticationFailureException extends PDFParseException {
32 | public PDFAuthenticationFailureException(String message) {
33 | super(message);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/decrypt/UnsupportedEncryptionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Pirion Systems Pty Ltd, 139 Warry St,
3 | * Fortitude Valley, Queensland, Australia
4 | *
5 | * This library is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * This library is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with this library; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | package com.sun.pdfview.decrypt;
21 |
22 | /**
23 | * Identifies that the specified encryption mechanism is not
24 | * supported by this product or platform.
25 | *
26 | * @see EncryptionUnsupportedByPlatformException
27 | * @see EncryptionUnsupportedByProductException
28 | * @author Luke Kirby
29 | */
30 | public abstract class UnsupportedEncryptionException extends Exception {
31 |
32 | protected UnsupportedEncryptionException(String message) {
33 | super(message);
34 | }
35 |
36 | protected UnsupportedEncryptionException(String message, Throwable cause) {
37 | super(message, cause);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/FlPoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: FlPoint.java,v 1.2 2007/12/20 18:33:31 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.font;
23 |
24 | /**
25 | * A floating-point Point, with public fields. Also contains a flag
26 | * for "open" to indicate that the path this point is a member of has
27 | * or hasn't been closed.
28 | *
29 | * @author Mike Wessler
30 | */
31 | public class FlPoint {
32 | /** x coordinate of the point */
33 | public float x= 0;
34 |
35 | /** y coordinate of the point */
36 | public float y= 0;
37 |
38 | /**
39 | * whether the path this point is a part of is open or closed.
40 | * used in Type1CFont.java.
41 | */
42 | public boolean open= false;
43 |
44 | /** reset the values to (0,0) and closed */
45 | public final void reset() {
46 | x= 0;
47 | y= 0;
48 | open= false;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/PDFCMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFCMap.java,v 1.3 2009/02/12 13:53:54 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 | package com.sun.pdfview.font;
22 |
23 | import java.io.IOException;
24 | import java.util.HashMap;
25 |
26 | import com.sun.pdfview.PDFObject;
27 |
28 | /**
29 | * A CMap maps from a character in a composite font to a font/glyph number
30 | * pair in a CID font.
31 | *
32 | * @author jkaplan
33 | */
34 | public abstract class PDFCMap {
35 | /**
36 | * A cache of known CMaps by name
37 | */
38 | private static HashMap cache;
39 |
40 | /** Creates a new instance of CMap */
41 | protected PDFCMap() {}
42 |
43 | /**
44 | * Get a CMap, given a PDF object containing one of the following:
45 | * a string name of a known CMap
46 | * a stream containing a CMap definition
47 | */
48 | public static PDFCMap getCMap(PDFObject map) throws IOException {
49 | if (map.getType() == PDFObject.NAME) {
50 | return getCMap(map.getStringValue());
51 | } else if (map.getType() == PDFObject.STREAM) {
52 | return parseCMap(map);
53 | } else {
54 | throw new IOException("CMap type not Name or Stream!");
55 | }
56 | }
57 |
58 | /**
59 | * Get a CMap, given a string name
60 | */
61 | public static PDFCMap getCMap(String mapName) throws IOException {
62 | if (cache == null) {
63 | populateCache();
64 | }
65 |
66 | if (!cache.containsKey(mapName)) {
67 | throw new IOException("Unknown CMap: " + mapName);
68 | }
69 |
70 | return (PDFCMap) cache.get(mapName);
71 | }
72 |
73 | /**
74 | * Populate the cache with well-known types
75 | */
76 | protected static void populateCache() {
77 | cache = new HashMap();
78 |
79 | // add the Identity-H map
80 | cache.put("Identity-H", new PDFCMap() {
81 | public char map(char src) {
82 | return src;
83 | }
84 | });
85 | }
86 |
87 | /**
88 | * Parse a CMap from a CMap stream
89 | */
90 | protected static PDFCMap parseCMap(PDFObject map) throws IOException {
91 | throw new IOException("Parsing CMap Files Unsupported!");
92 | }
93 |
94 | /**
95 | * Map a given source character to a destination character
96 | */
97 | public abstract char map(char src);
98 |
99 | /**
100 | * Get the font number assoicated with a given source character
101 | */
102 | public int getFontID(char src) {
103 | return 0;
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/PDFGlyph.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: PDFGlyph.java,v 1.3 2009/02/09 16:35:01 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.font;
23 |
24 | import java.awt.geom.AffineTransform;
25 | import java.awt.geom.GeneralPath;
26 | import java.awt.geom.Point2D;
27 |
28 | import com.sun.pdfview.PDFPage;
29 | import com.sun.pdfview.PDFShapeCmd;
30 |
31 | /**
32 | * A single glyph in a stream of PDF text, which knows how to write itself
33 | * onto a PDF command stream
34 | */
35 | public class PDFGlyph {
36 | /** the character code of this glyph */
37 | private char src;
38 |
39 | /** the name of this glyph */
40 | private String name;
41 |
42 | /** the advance from this glyph */
43 | private Point2D advance;
44 |
45 | /** the shape represented by this glyph (for all fonts but type 3) */
46 | private GeneralPath shape;
47 |
48 | /** the PDFPage storing this glyph's commands (for type 3 fonts) */
49 | private PDFPage page;
50 |
51 | /** Creates a new instance of PDFGlyph based on a shape */
52 | public PDFGlyph(char src, String name, GeneralPath shape,
53 | Point2D.Float advance) {
54 | this.shape = shape;
55 | this.advance = advance;
56 | this.src = src;
57 | this.name = name;
58 | }
59 |
60 | /** Creates a new instance of PDFGlyph based on a page */
61 | public PDFGlyph(char src, String name, PDFPage page, Point2D advance) {
62 | this.page = page;
63 | this.advance = advance;
64 | this.src = src;
65 | this.name = name;
66 | }
67 |
68 | /** Get the character code of this glyph */
69 | public char getChar() {
70 | return src;
71 | }
72 |
73 | /** Get the name of this glyph */
74 | public String getName() {
75 | return name;
76 | }
77 |
78 | /** Get the shape of this glyph */
79 | public GeneralPath getShape() {
80 | return shape;
81 | }
82 |
83 | /** Get the PDFPage for a type3 font glyph */
84 | public PDFPage getPage() {
85 | return page;
86 | }
87 |
88 | /** Add commands for this glyph to a page */
89 | public Point2D addCommands(PDFPage cmds, AffineTransform transform, int mode) {
90 | if (shape != null) {
91 | GeneralPath outline= (GeneralPath) shape.createTransformedShape(transform);
92 | cmds.addCommand(new PDFShapeCmd(outline, mode));
93 | } else if (page != null) {
94 | cmds.addCommands(page, transform);
95 | }
96 |
97 | return advance;
98 | }
99 |
100 | public String toString () {
101 | StringBuffer str = new StringBuffer ();
102 | str.append(name);
103 | return str.toString();
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/Type0Font.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: Type0Font.java,v 1.2 2007/12/20 18:33:32 rbair Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.font;
23 |
24 | import java.io.IOException;
25 |
26 | import com.sun.pdfview.PDFObject;
27 |
28 | /**
29 | * Type 0 fonts are composite fonts with a CMAP to map between
30 | * source character codes and destination fonts/codes
31 | *
32 | * @author Jonathan Kaplan
33 | */
34 | public class Type0Font extends PDFFont {
35 |
36 | /**
37 | * The decendant fonts, indexed by font number from the CMAP
38 | */
39 | PDFFont[] fonts;
40 |
41 | /** Creates a new instance of Type0Font */
42 | public Type0Font(String baseFont, PDFObject fontObj,
43 | PDFFontDescriptor descriptor) throws IOException {
44 | super (baseFont, descriptor);
45 |
46 | PDFObject[] descendantFonts = fontObj.getDictRef("DescendantFonts").getArray();
47 |
48 | fonts = new PDFFont[descendantFonts.length];
49 |
50 | for (int i = 0; i < descendantFonts.length; i++) {
51 | fonts[i] = PDFFont.getFont(descendantFonts[i], null);
52 | }
53 | }
54 |
55 | /**
56 | * Get a descendant font of this font by fontId
57 | */
58 | public PDFFont getDescendantFont(int fontID) {
59 | return fonts[fontID];
60 | }
61 |
62 | /**
63 | * Get a character from the first font in the descendant fonts array
64 | */
65 | protected PDFGlyph getGlyph(char src, String name) {
66 | return (getDescendantFont(0).getGlyph(src, name));
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/BaseFonts.properties:
--------------------------------------------------------------------------------
1 | # Sample ResourceBundle properties file
2 |
3 | Courier.file=n022003l.pfb
4 |
5 | Courier.length=96263
6 |
7 | Courier-Bold.file=n022004l.pfb
8 |
9 | Courier-Bold.length=120373
10 |
11 | Courier-BoldOblique.file=n022024l.pfb
12 |
13 | Courier-BoldOblique.length=114228
14 |
15 | Courier-Oblique.file=n022023l.pfb
16 |
17 | Courier-Oblique.length=101133
18 |
19 | Helvetica.file=n019003l.pfb
20 |
21 | Helvetica.length=68590
22 |
23 | Helvetica-Bold.file=n019004l.pfb
24 |
25 | Helvetica-Bold.length=72400
26 |
27 | Helvetica-BoldOblique.file=n019024l.pfb
28 |
29 | Helvetica-BoldOblique.length=73879
30 |
31 | Helvetica-Oblique.file=n019023l.pfb
32 |
33 | Helvetica-Oblique.length=71719
34 |
35 | Times-Roman.file=n021003l.pfb
36 |
37 | Times-Roman.length=113206
38 |
39 | Times-Bold.file=n021004l.pfb
40 |
41 | Times-Bold.length=108822
42 |
43 | Times-BoldItalic.file=n021024l.pfb
44 |
45 | Times-BoldItalic.length=96211
46 |
47 | Times-Italic.file=n021023l.pfb
48 |
49 | Times-Italic.length=108217
50 |
51 | Symbol.file=s050000l.pfb
52 |
53 | Symbol.length=32213
54 |
55 | ZapfDingbats.file=d050000l.pfb
56 |
57 | ZapfDingbats.length=45955
58 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/d050000l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/d050000l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n019003l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n019003l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n019004l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n019004l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n019023l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n019023l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n019024l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n019024l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n021003l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n021003l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n021004l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n021004l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n021023l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n021023l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n021024l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n021024l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n022003l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n022003l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n022004l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n022004l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n022023l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n022023l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/n022024l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/n022024l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/res/s050000l.pfb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/res/s050000l.pfb
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/ttf/LocaTable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id: LocaTable.java,v 1.3 2009/03/15 12:33:17 tomoke Exp $
3 | *
4 | * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5 | * Santa Clara, California 95054, U.S.A. All rights reserved.
6 | *
7 | * This library is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * This library is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with this library; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | package com.sun.pdfview.font.ttf;
23 |
24 | import java.nio.ByteBuffer;
25 |
26 | /**
27 | * Model the TrueType Loca table
28 | */
29 | public class LocaTable extends TrueTypeTable {
30 | /** if true, the table stores glyphs in long format */
31 | private boolean isLong;
32 |
33 | /** the offsets themselves */
34 | private int offsets[];
35 |
36 | /** Creates a new instance of HmtxTable */
37 | protected LocaTable(TrueTypeFont ttf) {
38 | super (TrueTypeTable.LOCA_TABLE);
39 |
40 | MaxpTable maxp = (MaxpTable) ttf.getTable("maxp");
41 | int numGlyphs = maxp.getNumGlyphs();
42 |
43 | HeadTable head = (HeadTable) ttf.getTable("head");
44 | short format = head.getIndexToLocFormat();
45 | isLong = (format == 1);
46 |
47 | offsets = new int[numGlyphs + 1];
48 | }
49 |
50 | /**
51 | * get the offset, in bytes, of a given glyph from the start of
52 | * the glyph table
53 | */
54 | public int getOffset(int glyphID) {
55 | return offsets[glyphID];
56 | }
57 |
58 | /**
59 | * get the size, in bytes, of the given glyph
60 | */
61 | public int getSize(int glyphID) {
62 | return offsets[glyphID + 1] - offsets[glyphID];
63 | }
64 |
65 | /**
66 | * Return true if the glyphs arte in long (int) format, or
67 | * false if they are in short (short) format
68 | */
69 | public boolean isLongFormat() {
70 | return isLong;
71 | }
72 |
73 |
74 | /** get the data in this map as a ByteBuffer */
75 | public ByteBuffer getData() {
76 | int size = getLength();
77 |
78 | ByteBuffer buf = ByteBuffer.allocate(size);
79 |
80 | // write the offsets
81 | for (int i = 0; i < offsets.length; i++) {
82 | if (isLongFormat()) {
83 | buf.putInt(offsets[i]);
84 | } else {
85 | buf.putShort((short) (offsets[i] / 2));
86 | }
87 | }
88 |
89 | // reset the start pointer
90 | buf.flip();
91 |
92 | return buf;
93 | }
94 |
95 | /** Initialize this structure from a ByteBuffer */
96 | public void setData(ByteBuffer data) {
97 | for (int i = 0; i < offsets.length; i++) {
98 | if (isLongFormat()) {
99 | offsets[i] = data.getInt();
100 | } else {
101 | offsets[i] = 2 * ( 0xFFFF & (int) data.getShort());
102 | }
103 | }
104 | }
105 |
106 | /**
107 | * Get the length of this table
108 | */
109 | public int getLength() {
110 | if (isLongFormat()) {
111 | return offsets.length * 4;
112 | } else {
113 | return offsets.length * 2;
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/src/com/sun/pdfview/font/ttf/resource/glyphlist.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/src/com/sun/pdfview/font/ttf/resource/glyphlist.txt
--------------------------------------------------------------------------------
/src/test/README:
--------------------------------------------------------------------------------
1 | To test on a file, cd to this directory and type:
2 |
3 | % java SlideIndex
4 |
5 | or
6 |
7 | % java Presenter
8 |
9 | Note that there are many, many pdf files that either won't render correctly,
10 | throw exceptions, or render mostly correctly except for some odd characters.
11 | Please note those files, and let us know about what went wrong, or dig into
12 | the code and fix it yourself. I don't suggest the latter until we get around
13 | to documenting the code. :)
14 |
--------------------------------------------------------------------------------
/src/test/overview.html:
--------------------------------------------------------------------------------
1 |
2 | 100% Java PDF viewer.
3 |
4 |
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_12.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_12.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_14.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_14.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_15.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_15.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_17.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_17.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_19_a.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_19_a.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_19_b.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_19_b.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_21.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_21.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_26.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_26.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_32.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_32.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_37.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_37.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_39.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_39.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_48.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_48.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_58.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_58.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_61.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_61.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_63.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_63.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_64.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_64.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_65.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_65.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_8.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_8.pdf
--------------------------------------------------------------------------------
/tests/samples/Fixed/issue_9.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Fixed/issue_9.pdf
--------------------------------------------------------------------------------
/tests/samples/HR Advert.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/HR Advert.pdf
--------------------------------------------------------------------------------
/tests/samples/IntelliJIDEA8_DataSheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/IntelliJIDEA8_DataSheet.pdf
--------------------------------------------------------------------------------
/tests/samples/Issue_41.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Issue_41.pdf
--------------------------------------------------------------------------------
/tests/samples/KDL46V3000_om_en.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/KDL46V3000_om_en.pdf
--------------------------------------------------------------------------------
/tests/samples/Patel/1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Patel/1.pdf
--------------------------------------------------------------------------------
/tests/samples/Patel/2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Patel/2.pdf
--------------------------------------------------------------------------------
/tests/samples/Patel/3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Patel/3.pdf
--------------------------------------------------------------------------------
/tests/samples/Patel/4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Patel/4.pdf
--------------------------------------------------------------------------------
/tests/samples/Patel/PDFRenderer_issue.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Patel/PDFRenderer_issue.doc
--------------------------------------------------------------------------------
/tests/samples/Started/issue_1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Started/issue_1.pdf
--------------------------------------------------------------------------------
/tests/samples/Started/issue_10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Started/issue_10.pdf
--------------------------------------------------------------------------------
/tests/samples/Started/issue_14.performance needed.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Started/issue_14.performance needed.pdf
--------------------------------------------------------------------------------
/tests/samples/Started/issue_17.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Started/issue_17.pdf
--------------------------------------------------------------------------------
/tests/samples/Started/issue_1a.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Started/issue_1a.pdf
--------------------------------------------------------------------------------
/tests/samples/Started/issue_66.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/Started/issue_66.pdf
--------------------------------------------------------------------------------
/tests/samples/border line/PrintPDF.java:
--------------------------------------------------------------------------------
1 | import java.awt.print.Book;
2 | import java.awt.print.PageFormat;
3 | import java.awt.print.Paper;
4 | import java.awt.print.PrinterException;
5 | import java.awt.print.PrinterJob;
6 | import java.io.FileInputStream;
7 | import java.io.IOException;
8 | import java.nio.ByteBuffer;
9 | import javax.print.PrintService;
10 | import javax.print.PrintServiceLookup;
11 | import javax.print.attribute.AttributeSet;
12 | import javax.print.attribute.HashAttributeSet;
13 | import javax.print.attribute.standard.PrinterName;
14 | import com.sun.pdfview.PDFFile;
15 | import com.sun.pdfview.PDFPrintPage;
16 |
17 | public class PrintPDF {
18 |
19 | public static void main(String[] args) throws IOException, PrinterException {
20 |
21 | String filePath = "C:\\Documents and Settings\\prashantp\\Desktop\\Test.pdf";
22 | String printerName = "ITC_6thFLR";
23 | int copies=1;
24 | PrintPDF printPDFFile = new PrintPDF();
25 | printPDFFile.printPDFFormat(filePath,printerName,copies);
26 | }
27 |
28 | public void printPDFFormat(String filePath,String printerName,int copies) {
29 |
30 | PrintService service = null;
31 | AttributeSet aset=null;
32 | FileInputStream inputStream=null;
33 | byte[] pdfContent=null;
34 | PDFFile pdfFile=null;
35 | PDFPrintPage pages=null;
36 | Book book=null;
37 | Paper paper=null;
38 | PrinterJob pjob=null;
39 | ByteBuffer bb=null;
40 | PrintService[] services=null;
41 |
42 | try{
43 |
44 | aset = new HashAttributeSet();
45 | book = new Book();
46 | paper = new Paper();
47 | aset.add(new PrinterName(printerName, null));
48 | inputStream = new FileInputStream(filePath);
49 | pdfContent = new byte[inputStream.available()];
50 | inputStream.read(pdfContent, 0, inputStream.available());
51 | bb = ByteBuffer.wrap(pdfContent);
52 | pdfFile = new PDFFile(bb);
53 | pages = new PDFPrintPage(pdfFile);
54 | PageFormat pf = PrinterJob.getPrinterJob().defaultPage();
55 | if (pdfFile.getNumPages()>=1 && ( (pdfFile.getPage(0).getWidth()) > (pdfFile.getPage(0).getHeight())) ){
56 | pf.setOrientation(PageFormat.LANDSCAPE);
57 | }
58 | book.append(pages, pf, pdfFile.getNumPages());
59 | paper.setImageableArea(0, 0, pdfFile.getPage(0).getWidth(), pdfFile.getPage(0).getHeight());
60 | pf.setPaper(paper);
61 | pjob = PrinterJob.getPrinterJob();
62 | pjob.setPageable(book);
63 | pjob.setCopies(copies);
64 | services = PrintServiceLookup.lookupPrintServices(null,aset);
65 | if (services != null && services.length > 0) {
66 | service = services[0];
67 | } else {
68 | service = PrintServiceLookup.lookupDefaultPrintService();
69 | }
70 | pjob.setPrintService(service);
71 | pjob.print();
72 | System.out.println("Done."+"Printer Name="+service.getName());
73 |
74 | }catch(Exception ex){
75 | ex.printStackTrace();
76 | }finally{
77 | if(bb!=null){
78 | bb.clear();
79 | bb=null;
80 | }
81 | try {
82 | if(inputStream!=null){
83 | inputStream.close();
84 | inputStream=null;
85 | }
86 |
87 | } catch (IOException e) {
88 | e.printStackTrace();
89 | }
90 | service = null;
91 | aset=null;
92 | pdfContent=null;
93 | pdfFile=null;
94 | pages=null;
95 | book=null;
96 | paper=null;
97 | pjob=null;
98 | services=null;
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/tests/samples/border line/PrintPDF/PrintPDF.jpx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tests/samples/border line/PrintPDF/PrintPDF.jpx.local:
--------------------------------------------------------------------------------
1 | build.menu.1[0]=com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;make
2 | build.menu.2[0]=com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;rebuild
3 | content.layout.xml.[0]=
4 | debug.NoTracingClasses.1[0]=23 com.borland.datastore.*1 1 -1
5 | debug.NoTracingClasses.10[0]=7 javax.*1 1 -1
6 | debug.NoTracingClasses.11[0]=5 sun.*1 1 -1
7 | debug.NoTracingClasses.2[0]=21 com.borland.dbswing.*1 1 -1
8 | debug.NoTracingClasses.3[0]=16 com.borland.dx.*1 1 -1
9 | debug.NoTracingClasses.4[0]=16 com.borland.jb.*1 1 -1
10 | debug.NoTracingClasses.5[0]=18 com.borland.jbcl.*1 1 -1
11 | debug.NoTracingClasses.6[0]=30 com.borland.jbuilder.runtime.*1 1 -1
12 | debug.NoTracingClasses.7[0]=17 com.borland.sql.*1 1 -1
13 | debug.NoTracingClasses.8[0]=9 com.sun.*1 1 -1
14 | debug.NoTracingClasses.9[0]=6 java.*1 1 -1
15 | import.optimize.legacyPropertiesRead[0]=1
16 | packagebrowser.lastClassName[0]=printpdf.PrintPDF
17 | sys.Author[0]=
18 | sys.DefaultPackage[0]=printpdf
19 | sys.ReopenHistory.1[0]=[C%|/Documents and Settings/tomoke/Local Settings/Temporary Internet Files/Content.IE5/4XL43LIG/PDFDecoder[1].java
20 | sys.ReopenHistory.10[0]=[C%|/Borland/JBuilder2006/jdk1.5/src.zip]/java/awt/print/PageFormat.java
21 | sys.ReopenHistory.11[0]=[C%|/Borland/JBuilder2006/jdk1.5/src.zip]/java/awt/geom/Rectangle2D.java
22 | sys.ReopenHistory.12[0]=[C%|/Borland/JBuilder2006/jdk1.5/src.zip]/javax/print/attribute/standard/PrinterName.java
23 | sys.ReopenHistory.13[0]=C%|/pdf-renderer/src/com/sun/pdfview/PDFPage.java
24 | sys.ReopenHistory.2[0]=C%|/Documents and Settings/tomoke/Desktop/pdf test/src/com/sun/pdfview/decode/CCITTFaxDecoder.java
25 | sys.ReopenHistory.3[0]=C%|/Documents and Settings/tomoke/Desktop/pdf test/src/com/sun/pdfview/decode/CCITTFaxDecode2.java
26 | sys.ReopenHistory.4[0]=C%|/Documents and Settings/tomoke/Desktop/pdf test/tests/samples/border line/PrintPDF.java
27 | sys.ReopenHistory.5[0]=[C%|/Documents and Settings/tomoke/Local Settings/Temporary Internet Files/Content.IE5/06J9UBYE/CCITTFaxDecoder[1].java
28 | sys.ReopenHistory.6[0]=[C%|/Borland/JBuilder2006/jdk1.5/src.zip]/java/awt/print/PrinterJob.java
29 | sys.ReopenHistory.7[0]=[C%|/pdf-renderer/dist/PDFRenderer.jar]/com/sun/pdfview/PDFPrintPage.class
30 | sys.ReopenHistory.8[0]=[C%|/Documents and Settings/tomoke/Local Settings/Temporary Internet Files/Content.IE5/AF7ROS0L/PDFDecoder[1].java
31 | sys.ReopenHistory.9[0]=[C%|/Borland/JBuilder2006/jdk1.5/jre/lib/rt.jar]/sun/print/RasterPrinterJob.class
32 | team.lastScanned[0]=1234541751436
33 | wizard.package.package_history.1[0]=printpdf
34 |
--------------------------------------------------------------------------------
/tests/samples/border line/PrintPDF/classes/package cache/printpdf.dep2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/border line/PrintPDF/classes/package cache/printpdf.dep2
--------------------------------------------------------------------------------
/tests/samples/border line/PrintPDF/classes/printpdf/PrintPDF.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/border line/PrintPDF/classes/printpdf/PrintPDF.class
--------------------------------------------------------------------------------
/tests/samples/border line/Test.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/border line/Test.pdf
--------------------------------------------------------------------------------
/tests/samples/ebay-renderer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/ebay-renderer.png
--------------------------------------------------------------------------------
/tests/samples/esppp.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/esppp.pdf
--------------------------------------------------------------------------------
/tests/samples/forum/27548.music glossary.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/forum/27548.music glossary.pdf
--------------------------------------------------------------------------------
/tests/samples/forum/2969..pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/forum/2969..pdf
--------------------------------------------------------------------------------
/tests/samples/issue63/pdfpatch.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue63/pdfpatch.zip
--------------------------------------------------------------------------------
/tests/samples/issue63/pdfpatch/AdobeGlyphList.java:
--------------------------------------------------------------------------------
1 |
2 | package com.sun.pdfview.font.ttf;
3 |
4 | import java.io.BufferedReader;
5 | import java.io.File;
6 | import java.io.FileReader;
7 | import java.util.HashMap;
8 | import java.util.Map;
9 | import java.util.StringTokenizer;
10 |
11 |
12 | public class AdobeGlyphList {
13 |
14 | private static Map name2index = new HashMap();
15 |
16 | static {
17 | try {
18 | File f = new File("resources/glyphlist.txt");
19 | BufferedReader input = new BufferedReader(new FileReader(f));
20 | try {
21 | String line;
22 |
23 | while (( line = input.readLine()) != null) {
24 |
25 | if(line.startsWith("#")) {
26 | continue;
27 | }
28 |
29 | StringTokenizer st = new StringTokenizer(line, " ;\r\n\t\f");
30 |
31 | if (!st.hasMoreTokens()) {
32 | continue;
33 | }
34 | String name = st.nextToken();
35 |
36 | if (!st.hasMoreTokens()) {
37 | continue;
38 | }
39 | String index = st.nextToken();
40 |
41 | name2index.put(name, Integer.valueOf(index, 16));
42 | }
43 | }
44 | finally {
45 | input.close();
46 | }
47 | }
48 | catch (Exception e){
49 | e.printStackTrace();
50 | }
51 | }
52 |
53 | public static Integer getGlyphIndexByName(String name) {
54 | return name2index.get(name);
55 | }
56 | }
--------------------------------------------------------------------------------
/tests/samples/issue_1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue_1.pdf
--------------------------------------------------------------------------------
/tests/samples/issue_19_a.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue_19_a.pdf
--------------------------------------------------------------------------------
/tests/samples/issue_19_b.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue_19_b.pdf
--------------------------------------------------------------------------------
/tests/samples/issue_28.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue_28.pdf
--------------------------------------------------------------------------------
/tests/samples/issue_33.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue_33.pdf
--------------------------------------------------------------------------------
/tests/samples/issue_44.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clintel/PDFRenderer/e848f2955019e1aa8a047ffb215a94bc2dcb5ab9/tests/samples/issue_44.pdf
--------------------------------------------------------------------------------