├── .openlogic.yaml ├── README ├── ant ├── .ant.properties ├── .ant.test.properties ├── compile.xml ├── pom.xml ├── release.xml └── site.xml ├── build.xml ├── core └── com │ └── lowagie │ ├── text │ ├── Anchor.java │ ├── Annotation.java │ ├── BadElementException.java │ ├── Cell.java │ ├── Chapter.java │ ├── ChapterAutoNumber.java │ ├── Chunk.java │ ├── DocListener.java │ ├── DocWriter.java │ ├── Document.java │ ├── DocumentException.java │ ├── Element.java │ ├── ElementListener.java │ ├── ElementTags.java │ ├── ExceptionConverter.java │ ├── Font.java │ ├── FontFactory.java │ ├── FontFactoryImp.java │ ├── GreekList.java │ ├── Header.java │ ├── HeaderFooter.java │ ├── Image.java │ ├── ImgCCITT.java │ ├── ImgJBIG2.java │ ├── ImgRaw.java │ ├── ImgTemplate.java │ ├── ImgWMF.java │ ├── Jpeg.java │ ├── Jpeg2000.java │ ├── LargeElement.java │ ├── List.java │ ├── ListItem.java │ ├── MPL-1.1.txt │ ├── MarkedObject.java │ ├── MarkedSection.java │ ├── Meta.java │ ├── PageSize.java │ ├── Paragraph.java │ ├── Phrase.java │ ├── Rectangle.java │ ├── RectangleReadOnly.java │ ├── RomanList.java │ ├── Row.java │ ├── RtfElementInterface.java │ ├── Section.java │ ├── SimpleCell.java │ ├── SimpleTable.java │ ├── SpecialSymbol.java │ ├── SplitCharacter.java │ ├── Table.java │ ├── TextElementArray.java │ ├── Utilities.java │ ├── ZapfDingbatsList.java │ ├── ZapfDingbatsNumberList.java │ ├── apache_license.txt │ ├── exceptions │ │ ├── BadPasswordException.java │ │ ├── IllegalPdfSyntaxException.java │ │ ├── InvalidPdfException.java │ │ └── UnsupportedPdfException.java │ ├── factories │ │ ├── ElementFactory.java │ │ ├── GreekAlphabetFactory.java │ │ ├── RomanAlphabetFactory.java │ │ └── RomanNumberFactory.java │ ├── html │ │ ├── HtmlEncoder.java │ │ ├── HtmlParser.java │ │ ├── HtmlPeer.java │ │ ├── HtmlTagMap.java │ │ ├── HtmlTags.java │ │ ├── HtmlWriter.java │ │ ├── Markup.java │ │ ├── SAXmyHtmlHandler.java │ │ ├── WebColors.java │ │ └── simpleparser │ │ │ ├── ALink.java │ │ │ ├── ChainedProperties.java │ │ │ ├── FactoryProperties.java │ │ │ ├── HTMLWorker.java │ │ │ ├── ImageProvider.java │ │ │ ├── Img.java │ │ │ ├── IncCell.java │ │ │ ├── IncTable.java │ │ │ └── StyleSheet.java │ ├── lgpl.txt │ ├── misc_licenses.txt │ ├── pdf │ │ ├── AcroFields.java │ │ ├── ArabicLigaturizer.java │ │ ├── AsianFontMapper.java │ │ ├── BadPdfFormatException.java │ │ ├── Barcode.java │ │ ├── Barcode128.java │ │ ├── Barcode39.java │ │ ├── BarcodeCodabar.java │ │ ├── BarcodeDatamatrix.java │ │ ├── BarcodeEAN.java │ │ ├── BarcodeEANSUPP.java │ │ ├── BarcodeInter25.java │ │ ├── BarcodePDF417.java │ │ ├── BarcodePostnet.java │ │ ├── BaseField.java │ │ ├── BaseFont.java │ │ ├── BidiLine.java │ │ ├── BidiOrder.java │ │ ├── ByteBuffer.java │ │ ├── CFFFont.java │ │ ├── CFFFontSubset.java │ │ ├── CJKFont.java │ │ ├── CMYKColor.java │ │ ├── CMapAwareDocumentFont.java │ │ ├── ColorDetails.java │ │ ├── ColumnText.java │ │ ├── DefaultFontMapper.java │ │ ├── DefaultSplitCharacter.java │ │ ├── DocumentFont.java │ │ ├── EnumerateTTC.java │ │ ├── ExtendedColor.java │ │ ├── ExtraEncoding.java │ │ ├── FdfReader.java │ │ ├── FdfWriter.java │ │ ├── FontDetails.java │ │ ├── FontMapper.java │ │ ├── FontSelector.java │ │ ├── GlyphList.java │ │ ├── GrayColor.java │ │ ├── HyphenationAuto.java │ │ ├── HyphenationEvent.java │ │ ├── IntHashtable.java │ │ ├── LZWDecoder.java │ │ ├── MappedRandomAccessFile.java │ │ ├── MultiColumnText.java │ │ ├── OcspClient.java │ │ ├── OcspClientBouncyCastle.java │ │ ├── OutputStreamCounter.java │ │ ├── OutputStreamEncryption.java │ │ ├── PRAcroForm.java │ │ ├── PRIndirectReference.java │ │ ├── PRStream.java │ │ ├── PRTokeniser.java │ │ ├── PageResources.java │ │ ├── PatternColor.java │ │ ├── PdfAcroForm.java │ │ ├── PdfAction.java │ │ ├── PdfAnnotation.java │ │ ├── PdfAppearance.java │ │ ├── PdfArray.java │ │ ├── PdfBoolean.java │ │ ├── PdfBorderArray.java │ │ ├── PdfBorderDictionary.java │ │ ├── PdfCell.java │ │ ├── PdfChunk.java │ │ ├── PdfColor.java │ │ ├── PdfContentByte.java │ │ ├── PdfContentParser.java │ │ ├── PdfContents.java │ │ ├── PdfCopy.java │ │ ├── PdfCopyFields.java │ │ ├── PdfCopyFieldsImp.java │ │ ├── PdfCopyForms.java │ │ ├── PdfCopyFormsImp.java │ │ ├── PdfDashPattern.java │ │ ├── PdfDate.java │ │ ├── PdfDestination.java │ │ ├── PdfDeveloperExtension.java │ │ ├── PdfDictionary.java │ │ ├── PdfDocument.java │ │ ├── PdfEFStream.java │ │ ├── PdfEncodings.java │ │ ├── PdfEncryption.java │ │ ├── PdfEncryptor.java │ │ ├── PdfException.java │ │ ├── PdfFileSpecification.java │ │ ├── PdfFont.java │ │ ├── PdfFormField.java │ │ ├── PdfFormXObject.java │ │ ├── PdfFunction.java │ │ ├── PdfGState.java │ │ ├── PdfGraphics2D.java │ │ ├── PdfICCBased.java │ │ ├── PdfImage.java │ │ ├── PdfImportedPage.java │ │ ├── PdfIndirectObject.java │ │ ├── PdfIndirectReference.java │ │ ├── PdfLayer.java │ │ ├── PdfLayerMembership.java │ │ ├── PdfLine.java │ │ ├── PdfLister.java │ │ ├── PdfLiteral.java │ │ ├── PdfMediaClipData.java │ │ ├── PdfName.java │ │ ├── PdfNameTree.java │ │ ├── PdfNull.java │ │ ├── PdfNumber.java │ │ ├── PdfNumberTree.java │ │ ├── PdfOCG.java │ │ ├── PdfOCProperties.java │ │ ├── PdfObject.java │ │ ├── PdfOutline.java │ │ ├── PdfPCell.java │ │ ├── PdfPCellEvent.java │ │ ├── PdfPKCS7.java │ │ ├── PdfPRow.java │ │ ├── PdfPSXObject.java │ │ ├── PdfPTable.java │ │ ├── PdfPTableEvent.java │ │ ├── PdfPage.java │ │ ├── PdfPageElement.java │ │ ├── PdfPageEvent.java │ │ ├── PdfPageEventHelper.java │ │ ├── PdfPageLabels.java │ │ ├── PdfPages.java │ │ ├── PdfPattern.java │ │ ├── PdfPatternPainter.java │ │ ├── PdfPrinterGraphics2D.java │ │ ├── PdfPublicKeyRecipient.java │ │ ├── PdfPublicKeySecurityHandler.java │ │ ├── PdfReader.java │ │ ├── PdfReaderInstance.java │ │ ├── PdfRectangle.java │ │ ├── PdfRendition.java │ │ ├── PdfResources.java │ │ ├── PdfShading.java │ │ ├── PdfShadingPattern.java │ │ ├── PdfSigGenericPKCS.java │ │ ├── PdfSignature.java │ │ ├── PdfSignatureAppearance.java │ │ ├── PdfSmartCopy.java │ │ ├── PdfSpotColor.java │ │ ├── PdfStamper.java │ │ ├── PdfStamperImp.java │ │ ├── PdfStream.java │ │ ├── PdfString.java │ │ ├── PdfStructureElement.java │ │ ├── PdfStructureTreeRoot.java │ │ ├── PdfTable.java │ │ ├── PdfTemplate.java │ │ ├── PdfTextArray.java │ │ ├── PdfTransition.java │ │ ├── PdfTransparencyGroup.java │ │ ├── PdfWriter.java │ │ ├── PdfXConformanceException.java │ │ ├── Pfm2afm.java │ │ ├── PushbuttonField.java │ │ ├── RadioCheckField.java │ │ ├── RandomAccessFileOrArray.java │ │ ├── SequenceList.java │ │ ├── ShadingColor.java │ │ ├── SimpleBookmark.java │ │ ├── SimpleNamedDestination.java │ │ ├── SpotColor.java │ │ ├── StampContent.java │ │ ├── StandardDecryption.java │ │ ├── TSAClient.java │ │ ├── TSAClientBouncyCastle.java │ │ ├── TextField.java │ │ ├── TrueTypeFont.java │ │ ├── TrueTypeFontSubSet.java │ │ ├── TrueTypeFontUnicode.java │ │ ├── Type1Font.java │ │ ├── Type3Font.java │ │ ├── Type3Glyph.java │ │ ├── VerticalText.java │ │ ├── XfaForm.java │ │ ├── XfdfReader.java │ │ ├── codec │ │ │ ├── Base64.java │ │ │ ├── BmpImage.java │ │ │ ├── CCITTG4Encoder.java │ │ │ ├── GifImage.java │ │ │ ├── JBIG2Image.java │ │ │ ├── JBIG2SegmentReader.java │ │ │ ├── PngImage.java │ │ │ ├── TIFFConstants.java │ │ │ ├── TIFFDirectory.java │ │ │ ├── TIFFFaxDecoder.java │ │ │ ├── TIFFField.java │ │ │ ├── TIFFLZWDecoder.java │ │ │ ├── TiffImage.java │ │ │ └── wmf │ │ │ │ ├── InputMeta.java │ │ │ │ ├── MetaBrush.java │ │ │ │ ├── MetaDo.java │ │ │ │ ├── MetaFont.java │ │ │ │ ├── MetaObject.java │ │ │ │ ├── MetaPen.java │ │ │ │ └── MetaState.java │ │ ├── collection │ │ │ ├── PdfCollection.java │ │ │ ├── PdfCollectionField.java │ │ │ ├── PdfCollectionItem.java │ │ │ ├── PdfCollectionSchema.java │ │ │ ├── PdfCollectionSort.java │ │ │ └── PdfTargetDictionary.java │ │ ├── crypto │ │ │ ├── AESCipher.java │ │ │ ├── ARCFOUREncryption.java │ │ │ └── IVGenerator.java │ │ ├── draw │ │ │ ├── DottedLineSeparator.java │ │ │ ├── DrawInterface.java │ │ │ ├── LineSeparator.java │ │ │ └── VerticalPositionMark.java │ │ ├── events │ │ │ ├── FieldPositioningEvents.java │ │ │ ├── IndexEvents.java │ │ │ ├── PdfPCellEventForwarder.java │ │ │ ├── PdfPTableEventForwarder.java │ │ │ └── PdfPageEventForwarder.java │ │ ├── fonts │ │ │ ├── Courier-Bold.afm │ │ │ ├── Courier-BoldOblique.afm │ │ │ ├── Courier-Oblique.afm │ │ │ ├── Courier.afm │ │ │ ├── FontsResourceAnchor.java │ │ │ ├── Helvetica-Bold.afm │ │ │ ├── Helvetica-BoldOblique.afm │ │ │ ├── Helvetica-Oblique.afm │ │ │ ├── Helvetica.afm │ │ │ ├── Symbol.afm │ │ │ ├── Times-Bold.afm │ │ │ ├── Times-BoldItalic.afm │ │ │ ├── Times-Italic.afm │ │ │ ├── Times-Roman.afm │ │ │ ├── ZapfDingbats.afm │ │ │ ├── cmap_info.txt │ │ │ ├── cmaps │ │ │ │ ├── CMap.java │ │ │ │ ├── CMapParser.java │ │ │ │ └── CodespaceRange.java │ │ │ ├── glyphlist.txt │ │ │ └── mustRead.html │ │ ├── hyphenation │ │ │ ├── ByteVector.java │ │ │ ├── CharVector.java │ │ │ ├── Hyphen.java │ │ │ ├── Hyphenation.java │ │ │ ├── HyphenationException.java │ │ │ ├── HyphenationTree.java │ │ │ ├── Hyphenator.java │ │ │ ├── PatternConsumer.java │ │ │ ├── SimplePatternParser.java │ │ │ └── TernaryTree.java │ │ ├── interfaces │ │ │ ├── PdfAnnotations.java │ │ │ ├── PdfDocumentActions.java │ │ │ ├── PdfEncryptionSettings.java │ │ │ ├── PdfPageActions.java │ │ │ ├── PdfRunDirection.java │ │ │ ├── PdfVersion.java │ │ │ ├── PdfViewerPreferences.java │ │ │ └── PdfXConformance.java │ │ ├── internal │ │ │ ├── PdfAnnotationsImp.java │ │ │ ├── PdfVersionImp.java │ │ │ ├── PdfViewerPreferencesImp.java │ │ │ ├── PdfXConformanceImp.java │ │ │ ├── PolylineShape.java │ │ │ └── PolylineShapeIterator.java │ │ └── parser │ │ │ ├── ContentOperator.java │ │ │ ├── GraphicsState.java │ │ │ ├── Matrix.java │ │ │ ├── PdfContentReaderTool.java │ │ │ ├── PdfContentStreamProcessor.java │ │ │ ├── PdfTextExtractor.java │ │ │ └── SimpleTextExtractingPdfContentStreamProcessor.java │ └── xml │ │ ├── SAXiTextHandler.java │ │ ├── SAXmyHandler.java │ │ ├── TagMap.java │ │ ├── XmlDomWriter.java │ │ ├── XmlParser.java │ │ ├── XmlPeer.java │ │ ├── simpleparser │ │ ├── EntitiesToSymbol.java │ │ ├── EntitiesToUnicode.java │ │ ├── IanaEncodings.java │ │ ├── SimpleXMLDocHandler.java │ │ ├── SimpleXMLDocHandlerComment.java │ │ └── SimpleXMLParser.java │ │ └── xmp │ │ ├── DublinCoreSchema.java │ │ ├── LangAlt.java │ │ ├── PdfA1Schema.java │ │ ├── PdfSchema.java │ │ ├── XmpArray.java │ │ ├── XmpBasicSchema.java │ │ ├── XmpMMSchema.java │ │ ├── XmpReader.java │ │ ├── XmpSchema.java │ │ └── XmpWriter.java │ └── tools │ ├── BuildTutorial.java │ ├── ConcatPdf.java │ ├── EncryptPdf.java │ ├── Executable.java │ ├── HandoutPdf.java │ ├── SplitPdf.java │ └── ToolboxAvailable.java ├── rtf └── com │ └── lowagie │ └── text │ └── rtf │ ├── RtfAddableElement.java │ ├── RtfBasicElement.java │ ├── RtfElement.java │ ├── RtfExtendedElement.java │ ├── RtfMapper.java │ ├── RtfWriter2.java │ ├── direct │ └── RtfDirectContent.java │ ├── document │ ├── RtfCodePage.java │ ├── RtfDocument.java │ ├── RtfDocumentHeader.java │ ├── RtfDocumentSettings.java │ ├── RtfGenerator.java │ ├── RtfInfoElement.java │ ├── RtfInfoGroup.java │ ├── RtfPageSetting.java │ ├── RtfProtection.java │ ├── RtfProtectionSetting.java │ └── output │ │ ├── RtfByteArrayBuffer.java │ │ ├── RtfDataCache.java │ │ ├── RtfDiskCache.java │ │ ├── RtfEfficientMemoryCache.java │ │ ├── RtfMemoryCache.java │ │ └── RtfNilOutputStream.java │ ├── field │ ├── RtfAnchor.java │ ├── RtfField.java │ ├── RtfPageNumber.java │ ├── RtfTOCEntry.java │ ├── RtfTableOfContents.java │ └── RtfTotalPageNumber.java │ ├── graphic │ ├── RtfImage.java │ ├── RtfShape.java │ ├── RtfShapePosition.java │ └── RtfShapeProperty.java │ ├── headerfooter │ ├── RtfHeaderFooter.java │ └── RtfHeaderFooterGroup.java │ ├── list │ ├── RtfList.java │ ├── RtfListItem.java │ ├── RtfListLevel.java │ ├── RtfListTable.java │ └── RtfPictureList.java │ ├── parser │ ├── RtfImportMappings.java │ ├── RtfImportMgr.java │ ├── RtfParser.java │ ├── RtfParserState.java │ ├── ctrlwords │ │ ├── RtfCtrlWordData.java │ │ ├── RtfCtrlWordHandler.java │ │ ├── RtfCtrlWordListener.java │ │ ├── RtfCtrlWordMap.java │ │ ├── RtfCtrlWordMgr.java │ │ └── RtfCtrlWordType.java │ ├── destinations │ │ ├── RtfDestination.java │ │ ├── RtfDestinationColorTable.java │ │ ├── RtfDestinationDocument.java │ │ ├── RtfDestinationFontTable.java │ │ ├── RtfDestinationInfo.java │ │ ├── RtfDestinationListTable.java │ │ ├── RtfDestinationListener.java │ │ ├── RtfDestinationMgr.java │ │ ├── RtfDestinationNull.java │ │ ├── RtfDestinationShppict.java │ │ └── RtfDestinationStylesheetTable.java │ ├── enumerations │ │ └── RtfColorThemes.java │ ├── exceptions │ │ ├── RtfParserException.java │ │ └── RtfUnknownCtrlWordException.java │ └── properties │ │ ├── RtfCtrlWordPropertyType.java │ │ ├── RtfProperty.java │ │ └── RtfPropertyListener.java │ ├── style │ ├── RtfColor.java │ ├── RtfColorList.java │ ├── RtfFont.java │ ├── RtfFontList.java │ ├── RtfParagraphStyle.java │ ├── RtfStyleTypes.java │ └── RtfStylesheetList.java │ ├── table │ ├── RtfBorder.java │ ├── RtfBorderGroup.java │ ├── RtfCell.java │ ├── RtfRow.java │ └── RtfTable.java │ └── text │ ├── RtfAnnotation.java │ ├── RtfChapter.java │ ├── RtfChunk.java │ ├── RtfNewPage.java │ ├── RtfParagraph.java │ ├── RtfPhrase.java │ ├── RtfSection.java │ ├── RtfTab.java │ └── RtfTabGroup.java ├── rups └── com │ └── lowagie │ └── rups │ ├── Rups.java │ ├── controller │ ├── PdfReaderController.java │ ├── PdfRendererController.java │ └── RupsController.java │ ├── io │ ├── FileChooserAction.java │ ├── FileCloseAction.java │ ├── OutputStreamResource.java │ ├── TextAreaOutputStream.java │ └── filters │ │ └── PdfFilter.java │ ├── model │ ├── BackgroundTask.java │ ├── IndirectObjectFactory.java │ ├── ObjectLoader.java │ ├── PageLoader.java │ ├── PdfFile.java │ ├── Permissions.java │ ├── ProgressDialog.java │ ├── TreeNodeFactory.java │ └── XfaFile.java │ └── view │ ├── Console.java │ ├── MessageAction.java │ ├── PageNavigationAction.java │ ├── PageNavigationListener.java │ ├── RupsMenuBar.java │ ├── icons │ ├── IconActionListener.java │ ├── IconButton.java │ ├── IconFetcher.java │ ├── IconTreeCellRenderer.java │ ├── IconTreeNode.java │ ├── array.png │ ├── attribute.png │ ├── boolean.png │ ├── copyright_notice.txt │ ├── dictionary.png │ ├── form.png │ ├── name.png │ ├── navigation_first.png │ ├── navigation_last.png │ ├── navigation_next.png │ ├── navigation_previous.png │ ├── null.png │ ├── number.png │ ├── outline.png │ ├── page.png │ ├── pages.png │ ├── pdf.png │ ├── pi.png │ ├── ref.png │ ├── ref_recursive.png │ ├── stream.png │ ├── string.png │ ├── tag.png │ ├── text.png │ └── xfa.png │ ├── itext │ ├── FormTree.java │ ├── OutlineTree.java │ ├── PagesTable.java │ ├── PdfObjectPanel.java │ ├── PdfTree.java │ ├── StreamTextArea.java │ ├── XRefTable.java │ ├── XfaTextArea.java │ ├── XfaTree.java │ └── treenodes │ │ ├── FormTreeNode.java │ │ ├── OutlineTreeNode.java │ │ ├── PdfObjectTreeNode.java │ │ ├── PdfPageTreeNode.java │ │ ├── PdfPagesTreeNode.java │ │ ├── PdfTrailerTreeNode.java │ │ ├── XdpTreeNode.java │ │ └── XfaTreeNode.java │ ├── models │ ├── DictionaryTableModel.java │ ├── JTableAutoModel.java │ ├── JTableAutoModelInterface.java │ └── PdfArrayTableModel.java │ └── renderer │ ├── PageField.java │ ├── PagePanel.java │ └── ToolBar.java ├── test.xml └── toolbox └── com └── lowagie └── toolbox ├── 1t3xt.gif ├── AbstractTool.java ├── ToolMenuItems.java ├── Toolbox.java ├── Versions.java ├── arguments ├── AbstractArgument.java ├── BitsetArgument.java ├── ColorArgument.java ├── FileArgument.java ├── FileArrayArgument.java ├── FloatArgument.java ├── ImageArgument.java ├── IntegerArgument.java ├── OptionArgument.java ├── PageSizeArgument.java ├── StringArgument.java └── filters │ ├── DirFilter.java │ ├── ImageFilter.java │ ├── PdfFilter.java │ └── U3DFilter.java ├── plugins ├── Add3D.java ├── Bookmarks2XML.java ├── Burst.java ├── CompressDecompressPageContent.java ├── Concat.java ├── ConcatN.java ├── Decrypt.java ├── Divide.java ├── DvdCover.java ├── Encrypt.java ├── ExtractAttachments.java ├── Handouts.java ├── HtmlBookmarks.java ├── ImageXRefViewer.java ├── InspectPDF.java ├── KnitTiff.java ├── NUp.java ├── Normalize.java ├── PhotoAlbum.java ├── RemoveLaunchApplication.java ├── ReversePages.java ├── SelectedPages.java ├── Split.java ├── Tiff2Pdf.java ├── Txt2Pdf.java ├── Watermarker.java ├── XML2Bookmarks.java ├── rotate.png ├── translate.png └── zoom.png ├── swing ├── CustomDialog.java ├── EventDispatchingThread.java ├── FileList.java └── PdfInformationPanel.java └── tools.txt /.openlogic.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: iText 2.1.7 Source 3 | platform_id: all 4 | platform_version: all 5 | distribution_file_uuid_string: openlogic-itext-2.1.7-all-src-1 6 | platform_vendor: all 7 | version_visibility: public 8 | description: iText 2.1.7 Source 9 | platform_arch: all 10 | distribution_file_uuid: 93f85f0983f7c4dc8975fead316a58f831bc142f486ec789783d003b73b2276a 11 | distribution_version: 1 12 | distribution_flavor: "" 13 | distribution_raw_file: 2.1.7/iText-src-2.1.7.tar.gz 14 | notify: "yes" 15 | package_version: 2.1.7 16 | package_id: itext 17 | release_date: "2010-04-15" 18 | distribution_notes: "" 19 | distribution_type: src 20 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | itext2 2 | ----------------------------------------------------------------------------- 3 | This is a fork of the original iText 2.1.7 source code, as downloaded from 4 | http://olex.openlogic.com/packages/itext/2.1.7. The original authors released 5 | this version of iText under both LGPL v2 and MPL v 1.1 licenses. This 6 | distribution retains those licenses. You can read the terms of those licenses 7 | at the link above. 8 | 9 | Subsequent versions of iText were released under Affero GPL and GPL. Those 10 | licenses govern iText version 5.0 and later. It appears the wgen-iText 11 | github repo forked from iText, 5.0.2. 12 | 13 | -------------------------------------------------------------------------------- /ant/.ant.properties: -------------------------------------------------------------------------------- 1 | releasenumber=2.1.7 2 | releasedate=2009-07-07 3 | 4 | itext.home=../.. 5 | 6 | itext.src=${itext.home}/src 7 | itext.www=${itext.home}/www 8 | itext.build=${itext.home}/build 9 | itext.lib=${itext.home}/lib 10 | 11 | itext.jar=${itext.lib}/iText.jar 12 | jfreechart.jar=${itext.lib}/jfreechart.jar 13 | jcommon.jar=${itext.lib}/jcommon.jar 14 | servlet.jar=${itext.lib}/servlet.jar 15 | 16 | bc.jdk=jdk14 17 | bc.version=138 18 | 19 | lib.bcmail=bcmail-${bc.jdk}-${bc.version}.jar 20 | lib.bcprov=bcprov-${bc.jdk}-${bc.version}.jar 21 | lib.bctsp=bctsp-${bc.jdk}-${bc.version}.jar 22 | lib.dom4j=pdf-renderer.jar 23 | lib.pdf-renderer=dom4j-1.6.1.jar 24 | 25 | itext.src.lowagie=${itext.www}/lowagie 26 | itext.src.tutorial=${itext.www}/tutorial 27 | itext.src.examples=${itext.www}/examples 28 | 29 | itext.bin=${itext.build}/bin 30 | itext.docs=${itext.build}/docs 31 | itext.lowagie=${itext.build}/lowagie 32 | itext.tutorial=${itext.build}/tutorial 33 | itext.examples=${itext.build}/examples 34 | itext.webapp=${itext.build}/webapp 35 | itext.release=${itext.build}/release 36 | itext.downloads=${itext.build}/downloads 37 | itext.dist=${itext.release}/dist 38 | itext.sf=${itext.release}/sf 39 | itext.maven=${itext.release}/maven 40 | 41 | itext.bin.temp=${itext.build}/bin.temp 42 | itext.jnlp=${itext.build}/jnlp 43 | 44 | itext.rups.src=${itext.src}/rups 45 | itext.rups.bin=${itext.build}/bin.rups 46 | itext.rups.jar=${itext.lib}/iText-rups.jar 47 | 48 | itext.toolbox.src=${itext.src}/toolbox 49 | itext.toolbox.bin=${itext.build}/bin.toolbox 50 | itext.toolbox.jar=${itext.lib}/iText-toolbox.jar 51 | 52 | itext.rtf.src=${itext.src}/rtf 53 | itext.rtf.bin=${itext.build}/bin.rtf 54 | itext.rtf.jar=${itext.lib}/iText-rtf.jar 55 | 56 | itext.keystore.filename=${itext.lib}/.keystore 57 | itext.keystore.password=dummypass 58 | itext.keystore.alias=itext 59 | itext.keystore.storetype=jks 60 | itext.keystore.dname=CN=iText Self-Signed Certificate 61 | 62 | itext.jdk.core=1.4 63 | itext.jdk.rups=1.5 64 | itext.jdk.toolbox=1.5 -------------------------------------------------------------------------------- /ant/.ant.test.properties: -------------------------------------------------------------------------------- 1 | itext.home=.. 2 | itext.build=${itext.home}/build 3 | itext.lib=${itext.home}/lib 4 | 5 | junit.jar=${itext.lib}/junit-4.4.jar 6 | 7 | itext.src.test=${itext.home}/test 8 | 9 | itext.bin.examples=${itext.build}/bin.examples 10 | itext.bin.test=${itext.build}/test 11 | itext.bin.data=${itext.build}/test.data 12 | itext.reports=${itext.build}/reports 13 | 14 | itext.rtf.test=${itext.build}/test.rtf 15 | 16 | itext.jdk.examples=1.4 17 | itext.jdk.test=1.5 18 | -------------------------------------------------------------------------------- /core/com/lowagie/text/ElementListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: ElementListener.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2001, 2002 by Bruno Lowagie. 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text; 51 | 52 | import java.util.EventListener; 53 | 54 | /** 55 | * A class that implements ElementListener will perform some 56 | * actions when an Element is added. 57 | * 58 | * @see DocListener 59 | */ 60 | 61 | public interface ElementListener extends EventListener { 62 | 63 | // methods 64 | 65 | /** 66 | * Signals that an Element was added to the Document. 67 | * 68 | * @param element a high level object 69 | * @return true if the element was added, false if not. 70 | * @throws DocumentException when a document isn't open yet, or has been closed 71 | */ 72 | 73 | public boolean add(Element element) throws DocumentException; // [L0] 74 | } -------------------------------------------------------------------------------- /core/com/lowagie/text/RtfElementInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: RtfElementInterface.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2008 by Bruno Lowagie 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the ?GNU LIBRARY GENERAL PUBLIC LICENSE?), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text; 51 | 52 | /** 53 | * The RTF jar depends on the iText jar, but the iText jar may not 54 | * depend on the RTF jar. This interface offers a temporary solution 55 | * until we find a more elegant way to solve this. 56 | * @since 2.1.0 57 | */ 58 | public interface RtfElementInterface { 59 | 60 | } 61 | -------------------------------------------------------------------------------- /core/com/lowagie/text/TextElementArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: TextElementArray.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright (c) 1999, 2000, 2001, 2002 Bruno Lowagie. 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text; 51 | 52 | /** 53 | * Interface for a text element to which other objects can be added. 54 | * 55 | * @see Phrase 56 | * @see Paragraph 57 | * @see Section 58 | * @see ListItem 59 | * @see Chapter 60 | * @see Anchor 61 | * @see Cell 62 | */ 63 | 64 | public interface TextElementArray extends Element { 65 | 66 | /** 67 | * Adds an object to the TextElementArray. 68 | * 69 | * @param o an object that has to be added 70 | * @return true if the addition succeeded; false otherwise 71 | */ 72 | public boolean add(Object o); 73 | } -------------------------------------------------------------------------------- /core/com/lowagie/text/exceptions/BadPasswordException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: BadPasswordException.java 3665 2009-01-26 22:32:15Z xlv $ 3 | * 4 | * Copyright 2007 by Bruno Lowagie. 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.exceptions; 51 | 52 | import java.io.IOException; 53 | 54 | /** 55 | * Typed exception used when opening an existing PDF document. 56 | * Gets thrown when the document isn't a valid PDF document. 57 | * @since 2.1.5 It was written for iText 2.0.8, but moved to another package 58 | */ 59 | public class BadPasswordException extends IOException { 60 | 61 | /** Serial Version UID. */ 62 | private static final long serialVersionUID = -4333706268155063964L; 63 | 64 | /** 65 | * Creates an exception saying the user password was incorrect. 66 | */ 67 | public BadPasswordException(String message) { 68 | super(message); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /core/com/lowagie/text/exceptions/IllegalPdfSyntaxException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IllegalPdfSyntaxException.java 3820 2009-03-25 10:30:01Z blowagie $ 3 | * 4 | * Copyright 2009 by Bruno Lowagie. 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2009 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2009 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.exceptions; 51 | 52 | /** 53 | * Typed exception used when creating PDF syntax that isn't valid. 54 | * @since 2.1.6 55 | */ 56 | public class IllegalPdfSyntaxException extends IllegalArgumentException { 57 | 58 | /** Serial version ID */ 59 | private static final long serialVersionUID = -643024246596031671L; 60 | 61 | /** 62 | * Creates an exception saying the PDF syntax isn't correct. 63 | * @param message some extra info about the exception 64 | */ 65 | public IllegalPdfSyntaxException(String message) { 66 | super(message); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /core/com/lowagie/text/exceptions/InvalidPdfException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: InvalidPdfException.java 3665 2009-01-26 22:32:15Z xlv $ 3 | * 4 | * Copyright 2009 Bruno Lowagie 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2009 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2009 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.exceptions; 51 | 52 | import java.io.IOException; 53 | 54 | /** 55 | * Typed exception used when opening an existing PDF document. 56 | * Gets thrown when the document isn't a valid PDF document. 57 | * @since 2.1.5 58 | */ 59 | public class InvalidPdfException extends IOException { 60 | 61 | /** a serial version UID */ 62 | private static final long serialVersionUID = -2319614911517026938L; 63 | 64 | /** 65 | * Creates an instance of a NoPdfException. 66 | * @param message the reason why the document isn't a PDF document according to iText. 67 | */ 68 | public InvalidPdfException(String message) { 69 | super(message); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /core/com/lowagie/text/html/simpleparser/ALink.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005 Paulo Soares 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | 48 | package com.lowagie.text.html.simpleparser; 49 | 50 | import com.lowagie.text.Paragraph; 51 | /** 52 | * 53 | * @author psoares 54 | */ 55 | public interface ALink { 56 | boolean process(Paragraph current, ChainedProperties cprops); 57 | } 58 | -------------------------------------------------------------------------------- /core/com/lowagie/text/html/simpleparser/ImageProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007 Paulo Soares 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | 48 | 49 | package com.lowagie.text.html.simpleparser; 50 | 51 | import com.lowagie.text.DocListener; 52 | import com.lowagie.text.Image; 53 | import java.util.HashMap; 54 | 55 | public interface ImageProvider { 56 | Image getImage(String src, HashMap h, ChainedProperties cprops, DocListener doc); 57 | } 58 | -------------------------------------------------------------------------------- /core/com/lowagie/text/html/simpleparser/Img.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005 Paulo Soares 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | 48 | package com.lowagie.text.html.simpleparser; 49 | 50 | import java.util.HashMap; 51 | 52 | import com.lowagie.text.DocListener; 53 | import com.lowagie.text.Image; 54 | 55 | /** 56 | * 57 | * @author psoares 58 | */ 59 | public interface Img { 60 | boolean process(Image img, HashMap h, ChainedProperties cprops, DocListener doc); 61 | } 62 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/OcspClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: OcspClient.java 3959 2009-06-09 08:31:05Z blowagie $ 3 | * 4 | * Copyright 2009 Paulo Soares 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2005 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2009 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf; 51 | 52 | /** 53 | * Interface for the OCSP Client. 54 | * @since 2.1.6 55 | */ 56 | public interface OcspClient { 57 | /** 58 | * Gets an encoded byte array. 59 | * @return a byte array 60 | */ 61 | public byte[] getEncoded(); 62 | } 63 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfBorderArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfBorderArray.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 1999, 2000, 2001, 2002 Bruno Lowagie 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf; 51 | 52 | /** 53 | * A PdfBorderArray defines the border of a PdfAnnotation. 54 | * 55 | * @see PdfArray 56 | */ 57 | 58 | public class PdfBorderArray extends PdfArray { 59 | 60 | // constructors 61 | 62 | /** 63 | * Constructs a new PdfBorderArray. 64 | */ 65 | 66 | public PdfBorderArray(float hRadius, float vRadius, float width) { 67 | this(hRadius, vRadius, width, null); 68 | } 69 | 70 | /** 71 | * Constructs a new PdfBorderArray. 72 | */ 73 | 74 | public PdfBorderArray(float hRadius, float vRadius, float width, PdfDashPattern dash) { 75 | super(new PdfNumber(hRadius)); 76 | add(new PdfNumber(vRadius)); 77 | add(new PdfNumber(width)); 78 | if (dash != null) 79 | add(dash); 80 | } 81 | } -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfMediaClipData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003 Galo Gimenez 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.pdf; 48 | 49 | import java.io.IOException; 50 | 51 | public class PdfMediaClipData extends PdfDictionary { 52 | 53 | PdfMediaClipData(String file, PdfFileSpecification fs, String mimeType) throws IOException { 54 | put(PdfName.TYPE,new PdfName("MediaClip")); 55 | put(PdfName.S, new PdfName("MCD")); 56 | put(PdfName.N, new PdfString("Media clip for "+file)); 57 | put(new PdfName("CT"), new PdfString(mimeType)); 58 | PdfDictionary dic = new PdfDictionary(); 59 | dic.put(new PdfName("TF"), new PdfString("TEMPACCESS")); 60 | put(new PdfName("P"), dic); 61 | put(PdfName.D, fs.getReference()); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfOCG.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004 by Paulo Soares. 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.pdf; 48 | 49 | /** 50 | * The interface common to all layer types. 51 | * 52 | * @author Paulo Soares (psoares@consiste.pt) 53 | */ 54 | public interface PdfOCG { 55 | 56 | /** 57 | * Gets the PdfIndirectReference that represents this layer. 58 | * @return the PdfIndirectReference that represents this layer 59 | */ 60 | public PdfIndirectReference getRef(); 61 | 62 | /** 63 | * Gets the object representing the layer. 64 | * @return the object representing the layer 65 | */ 66 | public PdfObject getPdfObject(); 67 | } 68 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfOCProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004 by Paulo Soares. 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.pdf; 48 | 49 | /** 50 | * This class represents the /OCProperties entry in the document catalog 51 | * and holds the optional content properties dictionary, which contains 52 | * a list of all the optional content groups in the document, as well as information 53 | * about the default and alternate configurations for optional content. 54 | * 55 | * @author Paulo Soares (psoares@consiste.pt) 56 | */ 57 | public class PdfOCProperties extends PdfDictionary { 58 | 59 | } 60 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfPageElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfPageElement.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 1999, 2000, 2001, 2002 Bruno Lowagie 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf; 51 | 52 | /** 53 | * The PdfPageElement interface has to be implemented by PdfPage and PdfPages. 54 | * 55 | * @see PdfPage 56 | * @see PdfPages 57 | */ 58 | 59 | interface PdfPageElement { 60 | 61 | /** 62 | * Set the value for the Parent key in the Page or Pages Dictionary. 63 | * 64 | * @param reference an indirect reference to a PdfPages-object 65 | */ 66 | 67 | public void setParent(PdfIndirectReference reference); 68 | 69 | /** 70 | * Checks if this page element is a tree of pages. 71 | * 72 | * @return true if it's a tree of pages; 73 | * false if it's a single page 74 | */ 75 | 76 | public boolean isParent(); 77 | } -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfPrinterGraphics2D.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfPrinterGraphics2D.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2004 Paulo Soares and Alexandru Carstoiu 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2005 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2005 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf; 51 | 52 | import java.awt.print.PrinterGraphics; 53 | import java.awt.print.PrinterJob; 54 | 55 | /** 56 | * This is an extension class for the sole purpose of implementing the 57 | * {@link java.awt.print.PrinterGraphics PrinterGraphics} interface. 58 | */ 59 | public class PdfPrinterGraphics2D extends PdfGraphics2D implements PrinterGraphics 60 | { 61 | private PrinterJob printerJob; 62 | 63 | public PdfPrinterGraphics2D(PdfContentByte cb, float width, float height, FontMapper fontMapper, 64 | boolean onlyShapes, boolean convertImagesToJPEG, float quality, PrinterJob printerJob) { 65 | super(cb, width, height, fontMapper, onlyShapes, convertImagesToJPEG, quality); 66 | this.printerJob = printerJob; 67 | } 68 | 69 | public PrinterJob getPrinterJob() { 70 | return printerJob; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfPublicKeyRecipient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfPublicKeyRecipient.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2006 Paulo Soares 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2007 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2007 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf; 51 | 52 | import java.security.cert.Certificate; 53 | 54 | public class PdfPublicKeyRecipient { 55 | 56 | private Certificate certificate = null; 57 | 58 | private int permission = 0; 59 | 60 | protected byte[] cms = null; 61 | 62 | public PdfPublicKeyRecipient(Certificate certificate, int permission) 63 | { 64 | this.certificate = certificate; 65 | this.permission = permission; 66 | } 67 | 68 | public Certificate getCertificate() { 69 | return certificate; 70 | } 71 | 72 | public int getPermission() { 73 | return permission; 74 | } 75 | 76 | protected void setCms(byte[] cms) { 77 | this.cms = cms; 78 | } 79 | 80 | protected byte[] getCms() { 81 | return cms; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfRendition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003 Galo Gimenez 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.pdf; 48 | 49 | import java.io.IOException; 50 | 51 | /** 52 | * A Rendition dictionary (pdf spec 1.5) 53 | */ 54 | public class PdfRendition extends PdfDictionary { 55 | PdfRendition(String file, PdfFileSpecification fs, String mimeType) throws IOException{ 56 | put(PdfName.S, new PdfName("MR")); 57 | put(PdfName.N, new PdfString("Rendition for "+file)); 58 | put(PdfName.C, new PdfMediaClipData(file, fs, mimeType)); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/PdfXConformanceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfXConformanceException.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2004 Paulo Soares 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2005 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2005 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf; 51 | 52 | /** 53 | * 54 | * @author psoares 55 | */ 56 | public class PdfXConformanceException extends RuntimeException { 57 | 58 | private static final long serialVersionUID = 9199144538884293397L; 59 | 60 | /** Creates a new instance of PdfXConformanceException. */ 61 | public PdfXConformanceException() { 62 | } 63 | 64 | /** 65 | * Creates a new instance of PdfXConformanceException. 66 | * @param s 67 | */ 68 | public PdfXConformanceException(String s) { 69 | super(s); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/codec/wmf/MetaObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: MetaObject.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2001, 2002 Paulo Soares 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf.codec.wmf; 51 | 52 | public class MetaObject { 53 | public static final int META_NOT_SUPPORTED = 0; 54 | public static final int META_PEN = 1; 55 | public static final int META_BRUSH = 2; 56 | public static final int META_FONT = 3; 57 | public int type = META_NOT_SUPPORTED; 58 | 59 | public MetaObject() { 60 | } 61 | 62 | public MetaObject(int type) { 63 | this.type = type; 64 | } 65 | 66 | public int getType() { 67 | return type; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/collection/PdfCollection.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.text.pdf.collection; 2 | 3 | import com.lowagie.text.pdf.PdfDictionary; 4 | import com.lowagie.text.pdf.PdfName; 5 | import com.lowagie.text.pdf.PdfString; 6 | 7 | public class PdfCollection extends PdfDictionary { 8 | 9 | /** A type of PDF Collection */ 10 | public static final int DETAILS = 0; 11 | /** A type of PDF Collection */ 12 | public static final int TILE = 1; 13 | /** A type of PDF Collection */ 14 | public static final int HIDDEN = 2; 15 | 16 | /** 17 | * Constructs a PDF Collection. 18 | * @param type the type of PDF collection. 19 | */ 20 | public PdfCollection(int type) { 21 | super(PdfName.COLLECTION); 22 | switch(type) { 23 | case TILE: 24 | put(PdfName.VIEW, PdfName.T); 25 | break; 26 | case HIDDEN: 27 | put(PdfName.VIEW, PdfName.H); 28 | break; 29 | default: 30 | put(PdfName.VIEW, PdfName.D); 31 | } 32 | } 33 | 34 | /** 35 | * Identifies the document that will be initially presented 36 | * in the user interface. 37 | * @param description the description that was used when attaching the file to the document 38 | */ 39 | public void setInitialDocument(String description) { 40 | put(PdfName.D, new PdfString(description, null)); 41 | } 42 | 43 | /** 44 | * Sets the Collection schema dictionary. 45 | * @param schema an overview of the collection fields 46 | */ 47 | public void setSchema(PdfCollectionSchema schema) { 48 | put(PdfName.SCHEMA, schema); 49 | } 50 | 51 | /** 52 | * Gets the Collection schema dictionary. 53 | * @return schema an overview of the collection fields 54 | */ 55 | public PdfCollectionSchema getSchema() { 56 | return (PdfCollectionSchema)get(PdfName.SCHEMA); 57 | } 58 | 59 | /** 60 | * Sets the Collection sort dictionary. 61 | * @param sort a collection sort dictionary 62 | */ 63 | public void setSort(PdfCollectionSort sort) { 64 | put(PdfName.SORT, sort); 65 | } 66 | } -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/collection/PdfCollectionSchema.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.text.pdf.collection; 2 | 3 | import com.lowagie.text.pdf.PdfDictionary; 4 | import com.lowagie.text.pdf.PdfName; 5 | 6 | public class PdfCollectionSchema extends PdfDictionary { 7 | /** 8 | * Creates a Collection Schema dictionary. 9 | */ 10 | public PdfCollectionSchema() { 11 | super(PdfName.COLLECTIONSCHEMA); 12 | } 13 | 14 | /** 15 | * Adds a Collection field to the Schema. 16 | * @param name the name of the collection field 17 | * @param field a Collection Field 18 | */ 19 | public void addField(String name, PdfCollectionField field) { 20 | put(new PdfName(name), field); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/collection/PdfCollectionSort.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.text.pdf.collection; 2 | 3 | import com.lowagie.text.pdf.PdfArray; 4 | import com.lowagie.text.pdf.PdfBoolean; 5 | import com.lowagie.text.pdf.PdfDictionary; 6 | import com.lowagie.text.pdf.PdfName; 7 | import com.lowagie.text.pdf.PdfObject; 8 | 9 | public class PdfCollectionSort extends PdfDictionary { 10 | 11 | /** 12 | * Constructs a PDF Collection Sort Dictionary. 13 | * @param key the key of the field that will be used to sort entries 14 | */ 15 | public PdfCollectionSort(String key) { 16 | super(PdfName.COLLECTIONSORT); 17 | put(PdfName.S, new PdfName(key)); 18 | } 19 | 20 | /** 21 | * Constructs a PDF Collection Sort Dictionary. 22 | * @param keys the keys of the fields that will be used to sort entries 23 | */ 24 | public PdfCollectionSort(String[] keys) { 25 | super(PdfName.COLLECTIONSORT); 26 | PdfArray array = new PdfArray(); 27 | for (int i = 0; i < keys.length; i++) { 28 | array.add(new PdfName(keys[i])); 29 | } 30 | put(PdfName.S, array); 31 | } 32 | 33 | /** 34 | * Defines the sort order of the field (ascending or descending). 35 | * @param ascending true is the default, use false for descending order 36 | */ 37 | public void setSortOrder(boolean ascending) { 38 | PdfObject o = get(PdfName.S); 39 | if (o instanceof PdfName) { 40 | put(PdfName.A, new PdfBoolean(ascending)); 41 | } 42 | else { 43 | throw new IllegalArgumentException("You have to define a boolean array for this collection sort dictionary."); 44 | } 45 | } 46 | 47 | /** 48 | * Defines the sort order of the field (ascending or descending). 49 | * @param ascending an array with every element corresponding with a name of a field. 50 | */ 51 | public void setSortOrder(boolean[] ascending) { 52 | PdfObject o = get(PdfName.S); 53 | if (o instanceof PdfArray) { 54 | if (((PdfArray)o).size() != ascending.length) { 55 | throw new IllegalArgumentException("The number of booleans in this array doesn't correspond with the number of fields."); 56 | } 57 | PdfArray array = new PdfArray(); 58 | for (int i = 0; i < ascending.length; i++) { 59 | array.add(new PdfBoolean(ascending[i])); 60 | } 61 | put(PdfName.A, array); 62 | } 63 | else { 64 | throw new IllegalArgumentException("You need a single boolean for this collection sort dictionary."); 65 | } 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/fonts/FontsResourceAnchor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004 by Paulo Soares. 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.pdf.fonts; 48 | 49 | /** 50 | * A class to facilitate the loading of resources 51 | * 52 | * @author Paulo Soares (psoares@consiste.pt) 53 | */ 54 | public class FontsResourceAnchor { 55 | 56 | /** 57 | * Creates a FontsResourceAnchor 58 | */ 59 | public FontsResourceAnchor() { 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/fonts/cmaps/CodespaceRange.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2005, www.fontbox.org 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. Neither the name of fontbox; nor the names of its 14 | * contributors may be used to endorse or promote products derived from this 15 | * software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * http://www.fontbox.org 29 | * 30 | */ 31 | package com.lowagie.text.pdf.fonts.cmaps; 32 | 33 | /** 34 | * This represents a single entry in the codespace range. 35 | * 36 | * @author Ben Litchfield (ben@benlitchfield.com) 37 | * @version $Revision: 3646 $ 38 | * @since 2.1.4 39 | */ 40 | public class CodespaceRange 41 | { 42 | 43 | private byte[] start; 44 | private byte[] end; 45 | 46 | /** 47 | * Creates a new instance of CodespaceRange. 48 | */ 49 | public CodespaceRange() 50 | { 51 | } 52 | 53 | /** Getter for property end. 54 | * @return Value of property end. 55 | * 56 | */ 57 | public byte[] getEnd() 58 | { 59 | return this.end; 60 | } 61 | 62 | /** Setter for property end. 63 | * @param endBytes New value of property end. 64 | * 65 | */ 66 | public void setEnd(byte[] endBytes) 67 | { 68 | end = endBytes; 69 | } 70 | 71 | /** Getter for property start. 72 | * @return Value of property start. 73 | * 74 | */ 75 | public byte[] getStart() 76 | { 77 | return this.start; 78 | } 79 | 80 | /** Setter for property start. 81 | * @param startBytes New value of property start. 82 | * 83 | */ 84 | public void setStart(byte[] startBytes) 85 | { 86 | start = startBytes; 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/fonts/mustRead.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Core 14 AFM Files - ReadMe 6 | 7 | 8 | or 9 | 10 | 11 | 12 | 13 | 14 |
This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. Col
15 | 16 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/hyphenation/Hyphen.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lowagie.text.pdf.hyphenation; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * This class represents a hyphen. A 'full' hyphen is made of 3 parts: 23 | * the pre-break text, post-break text and no-break. If no line-break 24 | * is generated at this position, the no-break text is used, otherwise, 25 | * pre-break and post-break are used. Typically, pre-break is equal to 26 | * the hyphen character and the others are empty. However, this general 27 | * scheme allows support for cases in some languages where words change 28 | * spelling if they're split across lines, like german's 'backen' which 29 | * hyphenates 'bak-ken'. BTW, this comes from TeX. 30 | * 31 | * @author Carlos Villegas 32 | */ 33 | 34 | public class Hyphen implements Serializable { 35 | private static final long serialVersionUID = -7666138517324763063L; 36 | public String preBreak; 37 | public String noBreak; 38 | public String postBreak; 39 | 40 | Hyphen(String pre, String no, String post) { 41 | preBreak = pre; 42 | noBreak = no; 43 | postBreak = post; 44 | } 45 | 46 | Hyphen(String pre) { 47 | preBreak = pre; 48 | noBreak = null; 49 | postBreak = null; 50 | } 51 | 52 | public String toString() { 53 | if (noBreak == null 54 | && postBreak == null 55 | && preBreak != null 56 | && preBreak.equals("-")) { 57 | return "-"; 58 | } 59 | StringBuffer res = new StringBuffer("{"); 60 | res.append(preBreak); 61 | res.append("}{"); 62 | res.append(postBreak); 63 | res.append("}{"); 64 | res.append(noBreak); 65 | res.append('}'); 66 | return res.toString(); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/hyphenation/Hyphenation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lowagie.text.pdf.hyphenation; 18 | 19 | /** 20 | * This class represents a hyphenated word. 21 | * 22 | * @author Carlos Villegas 23 | */ 24 | public class Hyphenation { 25 | 26 | private int[] hyphenPoints; 27 | private String word; 28 | 29 | /** 30 | * number of hyphenation points in word 31 | */ 32 | private int len; 33 | 34 | /** 35 | * rawWord as made of alternating strings and {@link Hyphen Hyphen} 36 | * instances 37 | */ 38 | Hyphenation(String word, int[] points) { 39 | this.word = word; 40 | hyphenPoints = points; 41 | len = points.length; 42 | } 43 | 44 | /** 45 | * @return the number of hyphenation points in the word 46 | */ 47 | public int length() { 48 | return len; 49 | } 50 | 51 | /** 52 | * @return the pre-break text, not including the hyphen character 53 | */ 54 | public String getPreHyphenText(int index) { 55 | return word.substring(0, hyphenPoints[index]); 56 | } 57 | 58 | /** 59 | * @return the post-break text 60 | */ 61 | public String getPostHyphenText(int index) { 62 | return word.substring(hyphenPoints[index]); 63 | } 64 | 65 | /** 66 | * @return the hyphenation points 67 | */ 68 | public int[] getHyphenationPoints() { 69 | return hyphenPoints; 70 | } 71 | 72 | public String toString() { 73 | StringBuffer str = new StringBuffer(); 74 | int start = 0; 75 | for (int i = 0; i < len; i++) { 76 | str.append(word.substring(start, hyphenPoints[i])).append('-'); 77 | start = hyphenPoints[i]; 78 | } 79 | str.append(word.substring(start)); 80 | return str.toString(); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/hyphenation/HyphenationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lowagie.text.pdf.hyphenation; 18 | 19 | /** 20 | * @author Carlos Villegas 21 | */ 22 | public class HyphenationException extends Exception { 23 | 24 | private static final long serialVersionUID = 4721513606846982325L; 25 | 26 | public HyphenationException(String msg) { 27 | super(msg); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/hyphenation/PatternConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.lowagie.text.pdf.hyphenation; 18 | 19 | import java.util.ArrayList; 20 | 21 | /** 22 | * This interface is used to connect the XML pattern file parser to 23 | * the hyphenation tree. 24 | * 25 | * @author Carlos Villegas 26 | */ 27 | public interface PatternConsumer { 28 | 29 | /** 30 | * Add a character class. 31 | * A character class defines characters that are considered 32 | * equivalent for the purpose of hyphenation (e.g. "aA"). It 33 | * usually means to ignore case. 34 | * @param chargroup character group 35 | */ 36 | void addClass(String chargroup); 37 | 38 | /** 39 | * Add a hyphenation exception. An exception replaces the 40 | * result obtained by the algorithm for cases for which this 41 | * fails or the user wants to provide his own hyphenation. 42 | * A hyphenatedword is a vector of alternating String's and 43 | * {@link Hyphen Hyphen} instances 44 | */ 45 | void addException(String word, ArrayList hyphenatedword); 46 | 47 | /** 48 | * Add hyphenation patterns. 49 | * @param pattern the pattern 50 | * @param values interletter values expressed as a string of 51 | * digit characters. 52 | */ 53 | void addPattern(String pattern, String values); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/interfaces/PdfRunDirection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfRunDirection.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2006 Bruno Lowagie 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf.interfaces; 51 | 52 | public interface PdfRunDirection { 53 | 54 | /** Sets the run direction. This is only used as a placeholder 55 | * as it does not affect anything. 56 | * @param runDirection the run direction 57 | */ 58 | public void setRunDirection(int runDirection); 59 | 60 | /** Gets the run direction. 61 | * @return the run direction 62 | */ 63 | public int getRunDirection(); 64 | } 65 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/interfaces/PdfXConformance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfXConformance.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2006 Bruno Lowagie 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.pdf.interfaces; 51 | 52 | public interface PdfXConformance { 53 | 54 | /** 55 | * Sets the PDF/X conformance level. 56 | * Allowed values are PDFX1A2001, PDFX32002, PDFA1A and PDFA1B. 57 | * It must be called before opening the document. 58 | * @param pdfxConformance the conformance level 59 | */ 60 | public void setPDFXConformance(int pdfxConformance); 61 | 62 | /** 63 | * Getter for the PDF/X Conformance value. 64 | * @return the pdfxConformance 65 | */ 66 | public int getPDFXConformance(); 67 | 68 | /** 69 | * Checks if the PDF/X Conformance is necessary. 70 | * @return true if the PDF has to be in conformance with any of the PDF/X specifications 71 | */ 72 | public boolean isPdfX(); 73 | } 74 | -------------------------------------------------------------------------------- /core/com/lowagie/text/pdf/parser/ContentOperator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 by Kevin Day. 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999-2008 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000-2008 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.pdf.parser; 48 | 49 | import java.util.ArrayList; 50 | 51 | import com.lowagie.text.pdf.PdfLiteral; 52 | 53 | /** 54 | * Interface implemented by a series of content operators 55 | * @since 2.1.4 56 | */ 57 | public interface ContentOperator { 58 | /** 59 | * Invokes a content operator. 60 | * @param processor the processor that is dealing with the PDF content 61 | * @param operator the literal PDF syntax of the operator 62 | * @param operands the operands that come with the operator 63 | */ 64 | public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /core/com/lowagie/text/xml/simpleparser/SimpleXMLDocHandlerComment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003 Paulo Soares 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 1.1 5 | * (the "License"); you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 7 | * 8 | * Software distributed under the License is distributed on an "AS IS" basis, 9 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 | * for the specific language governing rights and limitations under the License. 11 | * 12 | * The Original Code is 'iText, a free JAVA-PDF library'. 13 | * 14 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 15 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 16 | * All Rights Reserved. 17 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 18 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 19 | * 20 | * Contributor(s): all the names of the contributors are added in the source code 21 | * where applicable. 22 | * 23 | * Alternatively, the contents of this file may be used under the terms of the 24 | * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the 25 | * provisions of LGPL are applicable instead of those above. If you wish to 26 | * allow use of your version of this file only under the terms of the LGPL 27 | * License and not to allow others to use your version of this file under 28 | * the MPL, indicate your decision by deleting the provisions above and 29 | * replace them with the notice and other provisions required by the LGPL. 30 | * If you do not delete the provisions above, a recipient may use your version 31 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 32 | * 33 | * This library is free software; you can redistribute it and/or modify it 34 | * under the terms of the MPL as stated above or under the terms of the GNU 35 | * Library General Public License as published by the Free Software Foundation; 36 | * either version 2 of the License, or any later version. 37 | * 38 | * This library is distributed in the hope that it will be useful, but WITHOUT 39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 40 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 41 | * details. 42 | * 43 | * If you didn't download this code from the following link, you should check if 44 | * you aren't using an obsolete version: 45 | * http://www.lowagie.com/iText/ 46 | */ 47 | package com.lowagie.text.xml.simpleparser; 48 | 49 | /** 50 | * The handler for the events fired by SimpleXMLParser. 51 | * @author Paulo Soares (psoares@consiste.pt) 52 | */ 53 | public interface SimpleXMLDocHandlerComment { 54 | /** 55 | * Called when a comment is found. 56 | * @param text the comment text 57 | */ 58 | public void comment(String text); 59 | } -------------------------------------------------------------------------------- /rtf/com/lowagie/text/rtf/RtfExtendedElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: RtfExtendedElement.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2001, 2002, 2003, 2004 by Mark Hall 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the ?GNU LIBRARY GENERAL PUBLIC LICENSE?), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | 50 | package com.lowagie.text.rtf; 51 | 52 | import java.io.IOException; 53 | import java.io.OutputStream; 54 | 55 | /** 56 | * The RtfExtendedElement interface is to be used for elements that also 57 | * write data into the definition part of the rtf document 58 | * 59 | * @version $Id: RtfExtendedElement.java 3373 2008-05-12 16:21:24Z xlv $ 60 | * @author Mark Hall (Mark.Hall@mail.room3b.eu) 61 | * @author Thomas Bickel (tmb99@inode.at) 62 | */ 63 | public interface RtfExtendedElement extends RtfBasicElement 64 | { 65 | /** 66 | * Write the definition part of the element 67 | * 68 | * @param out The OutputStream to write the element definition to 69 | */ 70 | public void writeDefinition(OutputStream out) throws IOException; 71 | } 72 | -------------------------------------------------------------------------------- /rtf/com/lowagie/text/rtf/parser/enumerations/RtfColorThemes.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.text.rtf.parser.enumerations; 2 | 3 | /** 4 | * Specifies the color theme values for use in Color Tables. 5 | * 6 | * @author Howard Shank (hgshank@yahoo.com) 7 | * @since 2.0.8 8 | */ 9 | public final class RtfColorThemes { 10 | public static final int THEME_UNDEFINED = -1; 11 | public static final int THEME_MAINDARKONE = 0; 12 | public static final int THEME_MAINDARKTWO = 1; 13 | public static final int THEME_MAINLIGHTONE = 2; 14 | public static final int THEME_MAINLIGHTTWO = 3; 15 | public static final int THEME_ACCENTONE = 4; 16 | public static final int THEME_ACCENTTWO = 5; 17 | public static final int THEME_ACCENTTHREE = 6; 18 | public static final int THEME_ACCENTFOUR = 7; 19 | public static final int THEME_ACCENTFIVE = 8; 20 | public static final int THEME_ACCENTSIX = 9; 21 | public static final int THEME_HYPERLINK = 10; 22 | public static final int THEME_FOLLOWEDHYPERLINK = 11; 23 | public static final int THEME_BACKGROUNDONE = 12; 24 | public static final int THEME_TEXTONE = 13; 25 | public static final int THEME_BACKGROUNDTWO = 14; 26 | public static final int THEME_TEXTTWO = 15; 27 | public static final int THEME_MAX = 15; 28 | } 29 | -------------------------------------------------------------------------------- /rtf/com/lowagie/text/rtf/parser/exceptions/RtfUnknownCtrlWordException.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.text.rtf.parser.exceptions; 2 | 3 | /** 4 | * @since 2.1.0 5 | */ 6 | public class RtfUnknownCtrlWordException extends RtfParserException { 7 | 8 | /** 9 | * Generated serial version UID. 10 | */ 11 | private static final long serialVersionUID = 7243046509505727849L; 12 | 13 | // constructors 14 | 15 | /** 16 | * Constructs a RtfParserException whithout a message. 17 | */ 18 | public RtfUnknownCtrlWordException() { 19 | super("Unknown control word."); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /rtf/com/lowagie/text/rtf/parser/properties/RtfCtrlWordPropertyType.java: -------------------------------------------------------------------------------- 1 | /* $Id: RtfCtrlWordPropertyType.java 3373 2008-05-12 16:21:24Z xlv $ 2 | * 3 | * Copyright 2007 by Howard Shank (hgshank@yahoo.com) 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 1.1 6 | * (the "License"); you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the License. 12 | * 13 | * The Original Code is 'iText, a free JAVA-PDF library'. 14 | * 15 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 16 | * the Initial Developer are Copyright (C) 1999-2006 by Bruno Lowagie. 17 | * All Rights Reserved. 18 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 19 | * are Copyright (C) 2000-2006 by Paulo Soares. All Rights Reserved. 20 | * 21 | * Contributor(s): all the names of the contributors are added in the source code 22 | * where applicable. 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of the 25 | * LGPL license (the ?GNU LIBRARY GENERAL PUBLIC LICENSE?), in which case the 26 | * provisions of LGPL are applicable instead of those above. If you wish to 27 | * allow use of your version of this file only under the terms of the LGPL 28 | * License and not to allow others to use your version of this file under 29 | * the MPL, indicate your decision by deleting the provisions above and 30 | * replace them with the notice and other provisions required by the LGPL. 31 | * If you do not delete the provisions above, a recipient may use your version 32 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 33 | * 34 | * This library is free software; you can redistribute it and/or modify it 35 | * under the terms of the MPL as stated above or under the terms of the GNU 36 | * Library General Public License as published by the Free Software Foundation; 37 | * either version 2 of the License, or any later version. 38 | * 39 | * This library is distributed in the hope that it will be useful, but WITHOUT 40 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 41 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 42 | * details. 43 | * 44 | * If you didn't download this code from the following link, you should check if 45 | * you aren't using an obsolete version: 46 | * http://www.lowagie.com/iText/ 47 | */ 48 | package com.lowagie.text.rtf.parser.properties; 49 | 50 | /** 51 | * @since 2.1.0 52 | */ 53 | public class RtfCtrlWordPropertyType { 54 | public static final int UNIDENTIFIED = -1; 55 | public static final int PROPERTY = 0; 56 | public static final int CHARACTER = 1; 57 | public static final int SPECIAL = 2; 58 | public static final int DESTINATION = 3; 59 | } 60 | -------------------------------------------------------------------------------- /rtf/com/lowagie/text/rtf/parser/properties/RtfPropertyListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: RtfPropertyListener.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2007 by Howard Shank (hgshank@yahoo.com) 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2006 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2006 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the ?GNU LIBRARY GENERAL PUBLIC LICENSE?), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | package com.lowagie.text.rtf.parser.properties; 50 | 51 | import java.util.EventListener; 52 | 53 | /** 54 | * RtfPropertyListener interface for handling events. 55 | * 56 | * @author Howard Shank (hgshank@yahoo.com) 57 | * 58 | * @since 2.0.8 59 | */ 60 | public interface RtfPropertyListener extends EventListener { 61 | /** 62 | * 63 | */ 64 | public void beforePropertyChange(String propertyName); 65 | /** 66 | * 67 | */ 68 | public void afterPropertyChange(String propertyName); 69 | } 70 | -------------------------------------------------------------------------------- /rtf/com/lowagie/text/rtf/style/RtfStyleTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: RtfStyleTypes.java 3373 2008-05-12 16:21:24Z xlv $ 3 | * 4 | * Copyright 2007 by Howard Shank (hgshank@yahoo.com) 5 | * 6 | * The contents of this file are subject to the Mozilla Public License Version 1.1 7 | * (the "License"); you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the License. 13 | * 14 | * The Original Code is 'iText, a free JAVA-PDF library'. 15 | * 16 | * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by 17 | * the Initial Developer are Copyright (C) 1999-2006 by Bruno Lowagie. 18 | * All Rights Reserved. 19 | * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer 20 | * are Copyright (C) 2000-2006 by Paulo Soares. All Rights Reserved. 21 | * 22 | * Contributor(s): all the names of the contributors are added in the source code 23 | * where applicable. 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of the 26 | * LGPL license (the ?GNU LIBRARY GENERAL PUBLIC LICENSE?), in which case the 27 | * provisions of LGPL are applicable instead of those above. If you wish to 28 | * allow use of your version of this file only under the terms of the LGPL 29 | * License and not to allow others to use your version of this file under 30 | * the MPL, indicate your decision by deleting the provisions above and 31 | * replace them with the notice and other provisions required by the LGPL. 32 | * If you do not delete the provisions above, a recipient may use your version 33 | * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. 34 | * 35 | * This library is free software; you can redistribute it and/or modify it 36 | * under the terms of the MPL as stated above or under the terms of the GNU 37 | * Library General Public License as published by the Free Software Foundation; 38 | * either version 2 of the License, or any later version. 39 | * 40 | * This library is distributed in the hope that it will be useful, but WITHOUT 41 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 42 | * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more 43 | * details. 44 | * 45 | * If you didn't download this code from the following link, you should check if 46 | * you aren't using an obsolete version: 47 | * http://www.lowagie.com/iText/ 48 | */ 49 | package com.lowagie.text.rtf.style; 50 | 51 | /** 52 | * RtfStyleTypes contains the different types of Stylesheet entries 53 | * that exist in RTF. 54 | * 55 | * @author Howard Shank (hgshank@yahoo.com) 56 | * @since 2.0.8 57 | */ 58 | public final class RtfStyleTypes { 59 | /** 60 | * Indicates paragraph style. 61 | */ 62 | public final static int PARAGRAPH = 0; 63 | /** 64 | * Indicates character style. 65 | */ 66 | public final static int CHARACTER = 0; 67 | /** 68 | * Indicates section style. 69 | */ 70 | public final static int SECTION = 2; 71 | /** 72 | * Indicates Table style. 73 | */ 74 | public final static int TABLE = 3; 75 | /** 76 | * Indicates table definition style. 77 | */ 78 | public final static int TABLE_STYLE_DEFINITION = 4; 79 | } 80 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/Rups.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Rups.java 3242 2008-04-13 23:00:20Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups; 22 | 23 | import java.awt.Dimension; 24 | import java.awt.Toolkit; 25 | 26 | import javax.swing.JFrame; 27 | 28 | import com.lowagie.rups.controller.RupsController; 29 | 30 | /** 31 | * iText RUPS is a tool that combines SUN's PDF Renderer (to view PDF 32 | * documents), iText's PdfReader (to inspect the internal structure of a 33 | * PDF file), and iText's PdfStamper to manipulate a PDF file. 34 | */ 35 | public class Rups { 36 | 37 | /** The version String; this String may only be changed by Bruno Lowagie. */ 38 | public static final String VERSION = "RUPS 0.0.1 (by lowagie.com)"; 39 | 40 | // main method 41 | /** 42 | * Main method of this PdfFrame class. 43 | * @param args no arguments needed 44 | */ 45 | public static void main(String[] args) { 46 | startApplication(); 47 | } 48 | 49 | // methods 50 | 51 | /** 52 | * Initializes the main components of the Rups application. 53 | */ 54 | public static void startApplication() { 55 | JFrame frame = new JFrame(); 56 | // size and location 57 | Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); 58 | frame.setSize((int)(screen.getWidth() * .90), (int)(screen.getHeight() * .90)); 59 | frame.setLocation((int)(screen.getWidth() * .05), (int)(screen.getHeight() * .05)); 60 | frame.setResizable(true); 61 | 62 | // title bar 63 | frame.setTitle("iText RUPS"); 64 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 65 | 66 | // the content 67 | RupsController controller = new RupsController(frame.getSize()); 68 | frame.setJMenuBar(controller.getMenuBar()); 69 | frame.getContentPane().add(controller.getMasterComponent(), java.awt.BorderLayout.CENTER); 70 | frame.setVisible(true); 71 | } 72 | 73 | // other member variables 74 | 75 | /** Serial Version UID. */ 76 | private static final long serialVersionUID = 4386633640535735848L; 77 | 78 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/io/FileChooserAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: FileChooserAction.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.io; 22 | 23 | import java.awt.event.ActionEvent; 24 | import java.io.File; 25 | import java.util.Observable; 26 | 27 | import javax.swing.AbstractAction; 28 | import javax.swing.JFileChooser; 29 | import javax.swing.filechooser.FileFilter; 30 | 31 | /** 32 | * Allows you to browse the file system and forwards the file 33 | * to the object that is waiting for you to choose a file. 34 | */ 35 | public class FileChooserAction extends AbstractAction { 36 | 37 | /** An object that is expecting the result of the file chooser action. */ 38 | protected Observable observable; 39 | /** A file filter to apply when browsing for a file. */ 40 | protected FileFilter filter; 41 | /** Indicates if you're browsing to create a new or an existing file. */ 42 | protected boolean newFile; 43 | /** The file that was chosen. */ 44 | protected File file; 45 | 46 | /** 47 | * Creates a new file chooser action. 48 | * @param observable the object waiting for you to select file 49 | * @param caption a description for the action 50 | * @param filter a filter to apply when browsing 51 | * @param newFile indicates if you should browse for a new or existing file 52 | */ 53 | public FileChooserAction(Observable observable, String caption, FileFilter filter, boolean newFile) { 54 | super(caption); 55 | this.observable = observable; 56 | this.filter = filter; 57 | this.newFile = newFile; 58 | } 59 | 60 | /** 61 | * Getter for the file. 62 | */ 63 | public File getFile() { 64 | return file; 65 | } 66 | 67 | /** 68 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 69 | */ 70 | public void actionPerformed(ActionEvent evt) { 71 | JFileChooser fc = new JFileChooser(); 72 | if (filter != null) { 73 | fc.setFileFilter(filter); 74 | } 75 | int okCancel; 76 | if (newFile) { 77 | okCancel = fc.showSaveDialog(null); 78 | } 79 | else { 80 | okCancel = fc.showOpenDialog(null); 81 | } 82 | if (okCancel == JFileChooser.APPROVE_OPTION) { 83 | file = fc.getSelectedFile(); 84 | observable.notifyObservers(this); 85 | } 86 | } 87 | 88 | /** A serial version UID. */ 89 | private static final long serialVersionUID = 2225830878098387118L; 90 | 91 | } 92 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/io/FileCloseAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: FileCloseAction.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.io; 22 | 23 | import java.awt.event.ActionEvent; 24 | import java.awt.event.ActionListener; 25 | import java.util.Observable; 26 | 27 | /** 28 | * Action that tells an observable to close a file and/or releases 29 | * resources relevant for the file that is being closed. 30 | */ 31 | public class FileCloseAction implements ActionListener { 32 | 33 | /** An object that allows you to close a file. */ 34 | protected Observable observable; 35 | 36 | /** 37 | * Creates the close action. 38 | * @param observable the object that expects you to close a file. 39 | */ 40 | public FileCloseAction(Observable observable) { 41 | this.observable = observable; 42 | } 43 | 44 | /** 45 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 46 | */ 47 | public void actionPerformed(ActionEvent evt) { 48 | observable.notifyObservers(this); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/io/OutputStreamResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: OutputStreamResource.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.io; 22 | 23 | import java.io.IOException; 24 | import java.io.OutputStream; 25 | 26 | /** 27 | * An object that implements this interface is a resource that 28 | * can be written to an OutputStream. 29 | */ 30 | public interface OutputStreamResource { 31 | /** 32 | * Writes a resource to an OutputStream. 33 | * @param os the OutputStream to which the XML is written. 34 | * @throws IOException usual exception when there's a problem writing to an OutputStream 35 | */ 36 | public void writeTo(OutputStream os) throws IOException; 37 | } 38 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/io/TextAreaOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: TextAreaOutputStream.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.io; 22 | 23 | import java.io.ByteArrayInputStream; 24 | import java.io.IOException; 25 | import java.io.OutputStream; 26 | 27 | import javax.swing.JTextArea; 28 | 29 | /** 30 | * Everything writing to this OutputStream will be shown in a JTextArea. 31 | */ 32 | public class TextAreaOutputStream extends OutputStream { 33 | /** The text area to which we want to write. */ 34 | protected JTextArea text; 35 | /** Keeps track of the offset of the text in the text area. */ 36 | protected int offset; 37 | 38 | /** 39 | * Constructs a TextAreaOutputStream. 40 | * @param text the text area to which we want to write. 41 | * @throws IOException 42 | */ 43 | public TextAreaOutputStream(JTextArea text) throws IOException { 44 | this.text = text; 45 | clear(); 46 | } 47 | 48 | /** 49 | * Clear the text area. 50 | */ 51 | public void clear() { 52 | text.setText(null); 53 | offset = 0; 54 | } 55 | 56 | /** 57 | * @see java.io.OutputStream#write(int) 58 | */ 59 | @Override 60 | public void write(int i) throws IOException { 61 | byte[] b = { (byte)i }; 62 | write(b, 0, 1); 63 | } 64 | 65 | /** 66 | * @see java.io.OutputStream#write(byte[], int, int) 67 | */ 68 | @Override 69 | public void write(byte[] b, int off, int len) throws IOException { 70 | String snippet = new String(b, off, len); 71 | text.insert(snippet, offset); 72 | offset += len - off; 73 | } 74 | 75 | /** 76 | * @see java.io.OutputStream#write(byte[]) 77 | */ 78 | @Override 79 | public void write(byte[] b) throws IOException { 80 | ByteArrayInputStream bais = new ByteArrayInputStream(b); 81 | byte[] snippet = new byte[1024]; 82 | int bytesread; 83 | while ((bytesread = bais.read(snippet)) > 0) { 84 | write(snippet, 0, bytesread); 85 | } 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/io/filters/PdfFilter.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.rups.io.filters; 2 | 3 | import java.io.File; 4 | 5 | import javax.swing.filechooser.FileFilter; 6 | 7 | 8 | /** 9 | * Filters PDF files in a JFileChooser. 10 | */ 11 | public class PdfFilter extends FileFilter { 12 | 13 | /** A public instance of the PdfFilter. */ 14 | public static final PdfFilter INSTANCE = new PdfFilter(); 15 | 16 | /** 17 | * 18 | * @see javax.swing.filechooser.FileFilter#accept(java.io.File) 19 | * @param f File 20 | * @return boolean 21 | */ 22 | public boolean accept(File f) { 23 | if (f.isDirectory()) return true; 24 | if (f.getName().toLowerCase().endsWith(".pdf")) return true; 25 | return false; 26 | } 27 | 28 | /** 29 | * 30 | * @see javax.swing.filechooser.FileFilter#getDescription() 31 | * @return String 32 | */ 33 | public String getDescription() { 34 | return "*.pdf PDF files"; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/model/ObjectLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: ObjectLoader.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.model; 22 | 23 | import java.util.Observable; 24 | 25 | import com.lowagie.text.pdf.PdfReader; 26 | 27 | /** 28 | * Loads the necessary iText PDF objects in Background. 29 | */ 30 | public class ObjectLoader extends BackgroundTask { 31 | /** This is the object that will forward the updates to the observers. */ 32 | protected Observable observable; 33 | /** iText's PdfReader object. */ 34 | protected PdfReader reader; 35 | /** The factory that can provide PDF objects. */ 36 | protected IndirectObjectFactory objects; 37 | /** The factory that can provide tree nodes. */ 38 | protected TreeNodeFactory nodes; 39 | 40 | /** 41 | * Creates a new ObjectLoader. 42 | * @param observable the object that will forward the changes. 43 | * @param reader the PdfReader from which the objects will be read. 44 | */ 45 | public ObjectLoader(Observable observable, PdfReader reader) { 46 | this.observable = observable; 47 | this.reader = reader; 48 | start(); 49 | } 50 | 51 | /** 52 | * Getter for the PdfReader object. 53 | * @return a reader object 54 | */ 55 | public PdfReader getReader() { 56 | return reader; 57 | } 58 | 59 | /** 60 | * Getter for the object factory. 61 | * @return an indirect object factory 62 | */ 63 | public IndirectObjectFactory getObjects() { 64 | return objects; 65 | } 66 | 67 | /** 68 | * Getter for the tree node factory. 69 | * @return a tree node factory 70 | */ 71 | public TreeNodeFactory getNodes() { 72 | return nodes; 73 | } 74 | 75 | /** 76 | * @see com.lowagie.rups.model.BackgroundTask#doTask() 77 | */ 78 | @Override 79 | public void doTask() { 80 | ProgressDialog progress = new ProgressDialog(null, "Reading PDF file"); 81 | objects = new IndirectObjectFactory(reader); 82 | int n = objects.getXRefMaximum(); 83 | progress.setMessage("Reading the Cross-Reference table"); 84 | progress.setTotal(n); 85 | while (objects.storeNextObject()) { 86 | progress.setValue(objects.getCurrent()); 87 | } 88 | progress.setTotal(0); 89 | nodes = new TreeNodeFactory(objects); 90 | progress.setMessage("Updating GUI"); 91 | observable.notifyObservers(this); 92 | progress.dispose(); 93 | } 94 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/model/PageLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PageLoader.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.model; 22 | 23 | import com.sun.pdfview.PDFFile; 24 | import com.sun.pdfview.PDFPage; 25 | 26 | /** 27 | * Loads all the PDFPage objects for SUN's PDF Renderer 28 | * in Background. 29 | */ 30 | public class PageLoader extends BackgroundTask { 31 | 32 | /** The PDFFile (SUN's PDF Renderer class) */ 33 | protected PDFFile file; 34 | /** The total number of pages. */ 35 | protected int numberOfPages; 36 | /** True for pages with page number equal to index + 1 that are being loaded. */ 37 | protected boolean[] busy; 38 | /** True for pages with page number equal to index + 1 that have already been loaded. */ 39 | protected boolean[] done; 40 | 41 | /** 42 | * Creates a new page loader. 43 | * @param file the PDFFile (SUN's PDF Renderer) 44 | */ 45 | public PageLoader(PDFFile file) { 46 | super(); 47 | this.file = file; 48 | numberOfPages = file.getNumPages(); 49 | busy = new boolean[numberOfPages]; 50 | done = new boolean[numberOfPages]; 51 | start(); 52 | } 53 | 54 | /** 55 | * Getter for the number of pages. 56 | * @return the number of pages in the PDF file. 57 | */ 58 | public int getNumberOfPages() { 59 | return numberOfPages; 60 | } 61 | 62 | /** 63 | * Loads a page. 64 | * @param pageNumber the number of the page that has to be loaded. 65 | * @return the PDFPage that has been loaded. 66 | */ 67 | public synchronized PDFPage loadPage(int pageNumber) { 68 | pageNumber--; 69 | if (busy[pageNumber]) return null; 70 | busy[pageNumber] = true; 71 | PDFPage page = file.getPage(pageNumber + 1, true); 72 | if (!done[pageNumber]) { 73 | System.out.println("Loading page " + (pageNumber + 1)); 74 | } 75 | done[pageNumber] = true; 76 | busy[pageNumber] = false; 77 | return page; 78 | } 79 | 80 | /** 81 | * @see com.lowagie.rups.model.BackgroundTask#doTask() 82 | */ 83 | @Override 84 | public void doTask() { 85 | for (int i = 0; i < numberOfPages; i++) { 86 | loadPage(i + 1); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/model/XfaFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: XfaFile.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.model; 22 | 23 | import java.io.ByteArrayInputStream; 24 | import java.io.ByteArrayOutputStream; 25 | import java.io.IOException; 26 | import java.io.OutputStream; 27 | 28 | import org.dom4j.Document; 29 | import org.dom4j.DocumentException; 30 | import org.dom4j.io.OutputFormat; 31 | import org.dom4j.io.SAXReader; 32 | import org.dom4j.io.XMLWriter; 33 | 34 | import com.lowagie.rups.io.OutputStreamResource; 35 | 36 | /** Class that deals with the XFA file that can be inside a PDF file. */ 37 | public class XfaFile implements OutputStreamResource { 38 | 39 | /** The X4J Document object (XML). */ 40 | protected Document xfaDocument; 41 | 42 | /** 43 | * Constructs an XFA file from an OutputStreamResource. 44 | * This resource can be an XML file or a node in a RUPS application. 45 | * @param resource the XFA resource 46 | * @throws IOException 47 | * @throws DocumentException 48 | */ 49 | public XfaFile(OutputStreamResource resource) throws IOException, DocumentException { 50 | // Is there a way to avoid loading everything in memory? 51 | // Can we somehow get the XML from the PDF as an InputSource, Reader or InputStream? 52 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 53 | resource.writeTo(baos); 54 | ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); 55 | SAXReader reader = new SAXReader(); 56 | xfaDocument = reader.read(bais); 57 | } 58 | 59 | /** 60 | * Getter for the XFA Document object. 61 | * @return a Document object (X4J) 62 | */ 63 | public Document getXfaDocument() { 64 | return xfaDocument; 65 | } 66 | 67 | /** 68 | * Writes a formatted XML file to the OutputStream. 69 | * @see com.lowagie.rups.io.OutputStreamResource#writeTo(java.io.OutputStream) 70 | */ 71 | public void writeTo(OutputStream os) throws IOException { 72 | if (xfaDocument == null) 73 | return; 74 | OutputFormat format = new OutputFormat(" ", true); 75 | XMLWriter writer = new XMLWriter(os, format); 76 | writer.write(xfaDocument); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/MessageAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: MessageAction.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view; 22 | 23 | import java.awt.event.ActionEvent; 24 | import java.awt.event.ActionListener; 25 | 26 | import javax.swing.JOptionPane; 27 | 28 | import com.lowagie.rups.Rups; 29 | import com.lowagie.text.Document; 30 | 31 | public class MessageAction implements ActionListener { 32 | 33 | public void actionPerformed(ActionEvent evt) { 34 | String message = "Unspecified message"; 35 | if (RupsMenuBar.ABOUT.equals(evt.getActionCommand())) { 36 | message = "RUPS is a tool by lowagie.com.\nIt uses iText, a Free Java-PDF Library\nand SUN's PDF Renderer.\nVisit http://www.lowagie.com/iText/ for more info."; 37 | } 38 | else if (RupsMenuBar.VERSIONS.equals(evt.getActionCommand())) { 39 | message = "RUPS version String: " + Rups.VERSION 40 | + "\niText version String: " + Document.getVersion() 41 | + "\nSUN's PDF Renderer version: version unknown"; 42 | } 43 | JOptionPane.showMessageDialog(null, message); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/PageNavigationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PageNavigationListener.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view; 22 | 23 | /** 24 | * Interface that has to be implemented by every class that listens 25 | * to page navigation features; keys that are pressed, buttons that 26 | * are pushed,... 27 | */ 28 | public interface PageNavigationListener { 29 | 30 | /** 31 | * Returns the total number of pages in a document. 32 | * @return the total number of pages in a document. 33 | */ 34 | public int getTotalNumberOfPages(); 35 | /** 36 | * Returns the current page number of a document. 37 | * @return the current page number. 38 | */ 39 | public int getCurrentPageNumber(); 40 | /** 41 | * Goes to the first page in a document. 42 | * @return the resulting page number. 43 | * Can be different from 1 if the document is null 44 | */ 45 | public int gotoFirstPage(); 46 | /** 47 | * Goes to the previous page in a document. 48 | * @return the resulting page number. 49 | * Can be different from (current page - 1) if the document is null 50 | * or the current page = 1. 51 | */ 52 | public int gotoPreviousPage(); 53 | /** 54 | * Goes to a specific page number in a document. 55 | * @param pageNumber 56 | * @return the resulting page number. 57 | * Can be different from pageNumber if pageNumber doesn't exist. 58 | */ 59 | public int gotoPage(int pageNumber); 60 | /** 61 | * Goes to the previous page in a document. 62 | * @return the resulting page number. 63 | * Can be different from (current page + 1) if the document is null 64 | * or the current page equals the total number of pages. 65 | */ 66 | public int gotoNextPage(); 67 | /** 68 | * Goes to the last page in a document. 69 | * @return the resulting page number. 70 | * Can be different from the total number of pages if the document is null 71 | */ 72 | public int gotoLastPage(); 73 | } 74 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/IconActionListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IconActionListener.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.icons; 22 | 23 | import java.awt.event.ActionListener; 24 | 25 | import javax.swing.Icon; 26 | 27 | /** 28 | * Special ActionListener to be implemented by Buttons that need an Icon. 29 | */ 30 | public interface IconActionListener extends ActionListener { 31 | /** Returns an Icon. */ 32 | public Icon getIcon(); 33 | } 34 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/IconButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IconButton.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.icons; 22 | 23 | import javax.swing.JButton; 24 | 25 | /** 26 | * JButton with an Icon that performs an Action if you push it. 27 | */ 28 | public class IconButton extends JButton { 29 | 30 | /** 31 | * Creates a button with an Icon that performs an 32 | * action when you push it. 33 | */ 34 | public IconButton(IconActionListener listener) { 35 | super(listener.getIcon()); 36 | addActionListener(listener); 37 | } 38 | 39 | /** A Serial Version UID. */ 40 | private static final long serialVersionUID = 3523016393512117003L; 41 | } 42 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/IconFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IconFetcher.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.icons; 22 | 23 | import java.util.HashMap; 24 | 25 | import javax.swing.Icon; 26 | import javax.swing.ImageIcon; 27 | 28 | /** 29 | * Class that fetches the icons in com.lowagie.trapeze.icons. 30 | */ 31 | public class IconFetcher { 32 | 33 | /** Cache with icons. */ 34 | protected static HashMap cache = new HashMap(); 35 | 36 | /** 37 | * Gets an Icon with a specific name. 38 | * @param filename the filename of the Icon. 39 | * @return an Icon 40 | */ 41 | public static Icon getIcon(String filename) { 42 | if (filename == null) { 43 | return null; 44 | } 45 | Icon icon = cache.get(filename); 46 | if (icon == null) { 47 | try { 48 | icon = new ImageIcon(IconFetcher.class.getResource(filename)); 49 | cache.put(filename, icon); 50 | } 51 | catch(Exception e) { 52 | System.err.println("Can't find file: " + filename); 53 | return null; 54 | } 55 | } 56 | return icon; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/IconTreeCellRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IconTreeCellRenderer.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.icons; 22 | 23 | import java.awt.Component; 24 | 25 | import javax.swing.JTree; 26 | import javax.swing.tree.DefaultTreeCellRenderer; 27 | 28 | 29 | /** 30 | * Renders the tree cells with the correct icon. 31 | */ 32 | public class IconTreeCellRenderer extends DefaultTreeCellRenderer { 33 | 34 | /** a serial version UID. */ 35 | private static final long serialVersionUID = 6513462839504342074L; 36 | 37 | /** 38 | * @see javax.swing.tree.DefaultTreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean) 39 | */ 40 | public Component getTreeCellRendererComponent(JTree tree, Object value, 41 | boolean selected, boolean expanded, boolean leaf, int row, 42 | boolean hasFocus) { 43 | super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); 44 | if (value instanceof IconTreeNode) { 45 | IconTreeNode node = (IconTreeNode) value; 46 | setIcon(node.getIcon()); 47 | } 48 | return this; 49 | } 50 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/IconTreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IconTreeNode.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.icons; 22 | 23 | import javax.swing.Icon; 24 | import javax.swing.tree.DefaultMutableTreeNode; 25 | 26 | /** 27 | * A tree node with a specific icon. 28 | */ 29 | public class IconTreeNode extends DefaultMutableTreeNode { 30 | 31 | /** The icon that has to be used for this TreeNode. */ 32 | protected Icon icon; 33 | 34 | /** 35 | * Constructs an IconTreeNode. 36 | * @param icon the filename of the icon to use for this node. 37 | */ 38 | public IconTreeNode(String icon) { 39 | super(); 40 | this.icon = IconFetcher.getIcon(icon); 41 | } 42 | 43 | /** 44 | * Constructs an IconTreeNode. 45 | * @param icon the filename of the icon to use for this node. 46 | * @param userobject the userobject for this node 47 | */ 48 | public IconTreeNode(String icon, Object userobject) { 49 | super(userobject); 50 | this.icon = IconFetcher.getIcon(icon); 51 | } 52 | 53 | /** Getter for the icon. */ 54 | public Icon getIcon() { 55 | return icon; 56 | } 57 | 58 | /** A Serial Version UID. */ 59 | private static final long serialVersionUID = -5900308991182960842L; 60 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/array.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/attribute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/attribute.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/boolean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/boolean.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/copyright_notice.txt: -------------------------------------------------------------------------------- 1 | Copyright notice for the icons in this directory: 2 | 3 | 4 | Silk icon set 1.3 5 | 6 | _________________________________________ 7 | Mark James 8 | http://www.famfamfam.com/lab/icons/silk/ 9 | _________________________________________ 10 | 11 | This work is licensed under a 12 | Creative Commons Attribution 2.5 License. 13 | [ http://creativecommons.org/licenses/by/2.5/ ] 14 | 15 | This means you may use it for any purpose, 16 | and make any changes you like. 17 | All I ask is that you include a link back 18 | to this page in your credits. 19 | 20 | Are you using this icon set? Send me an email 21 | (including a link or picture if available) to 22 | mjames at gmail dot com 23 | 24 | Any other questions about this icon set please 25 | contact mjames at gmail dot com -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/dictionary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/dictionary.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/form.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/name.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/navigation_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/navigation_first.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/navigation_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/navigation_last.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/navigation_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/navigation_next.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/navigation_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/navigation_previous.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/null.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/number.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/outline.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/page.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/pages.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/pdf.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/pi.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/ref.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/ref_recursive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/ref_recursive.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/stream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/stream.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/string.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/tag.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/text.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/icons/xfa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/rups/com/lowagie/rups/view/icons/xfa.png -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/PdfTree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfTree.java 3242 2008-04-13 23:00:20Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext; 22 | 23 | import java.util.Observable; 24 | import java.util.Observer; 25 | 26 | import javax.swing.JTree; 27 | import javax.swing.tree.DefaultTreeModel; 28 | import javax.swing.tree.TreePath; 29 | 30 | import com.lowagie.rups.view.icons.IconTreeCellRenderer; 31 | import com.lowagie.rups.view.itext.treenodes.PdfObjectTreeNode; 32 | import com.lowagie.rups.view.itext.treenodes.PdfTrailerTreeNode; 33 | 34 | /** 35 | * A JTree that shows the object hierarchy of a PDF document. 36 | */ 37 | public class PdfTree extends JTree implements Observer { 38 | 39 | /** The root of the PDF tree. */ 40 | protected PdfTrailerTreeNode root; 41 | 42 | /** 43 | * Constructs a PDF tree. 44 | */ 45 | public PdfTree() { 46 | super(); 47 | root = new PdfTrailerTreeNode(); 48 | setCellRenderer(new IconTreeCellRenderer()); 49 | update(null, null); 50 | } 51 | 52 | /** 53 | * Getter for the root node 54 | * @return the PDF Trailer node 55 | */ 56 | public PdfTrailerTreeNode getRoot() { 57 | return root; 58 | } 59 | 60 | /** 61 | * Updates the PdfTree when a file is closed or when a ObjectLoader 62 | * has finished loading objects. 63 | * @param observable the Observable class that started the update 64 | * @param obj the object that has all the updates 65 | * @see java.util.Observer#update(java.util.Observable, java.lang.Object) 66 | */ 67 | public void update(Observable observable, Object obj) { 68 | if (obj == null) { 69 | root = new PdfTrailerTreeNode(); 70 | } 71 | setModel(new DefaultTreeModel(root)); 72 | repaint(); 73 | } 74 | 75 | /** 76 | * Select a specific node in the tree. 77 | * Typically this method will be called from a different tree, 78 | * such as the pages, outlines or form tree. 79 | * @param node the node that has to be selected 80 | */ 81 | public void selectNode(PdfObjectTreeNode node) { 82 | TreePath path = new TreePath(node.getPath()); 83 | setSelectionPath(path); 84 | scrollPathToVisible(path); 85 | } 86 | 87 | /** a serial version UID */ 88 | private static final long serialVersionUID = 7545804447512085734L; 89 | 90 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/StreamTextArea.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: StreamTextArea.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext; 22 | import java.io.IOException; 23 | import java.util.Observable; 24 | import java.util.Observer; 25 | 26 | import javax.swing.JScrollPane; 27 | import javax.swing.JTextArea; 28 | 29 | import com.lowagie.rups.io.TextAreaOutputStream; 30 | import com.lowagie.text.pdf.PRStream; 31 | import com.lowagie.text.pdf.PdfObject; 32 | import com.lowagie.text.pdf.PdfReader; 33 | 34 | public class StreamTextArea extends JScrollPane implements Observer { 35 | 36 | /** The text area with the content stream. */ 37 | protected JTextArea text; 38 | 39 | /** 40 | * Constructs a StreamTextArea. 41 | */ 42 | public StreamTextArea() { 43 | super(); 44 | text = new JTextArea(); 45 | setViewportView(text); 46 | } 47 | 48 | /** 49 | * @see java.util.Observer#update(java.util.Observable, java.lang.Object) 50 | */ 51 | public void update(Observable observable, Object obj) { 52 | text.setText(null); 53 | } 54 | 55 | /** 56 | * Renders the content stream of a PdfObject or empties the text area. 57 | * @param object the object of which the content stream needs to be rendered 58 | */ 59 | public void render(PdfObject object) { 60 | if (object instanceof PRStream) { 61 | PRStream stream = (PRStream)object; 62 | try { 63 | TextAreaOutputStream taos = new TextAreaOutputStream(text); 64 | taos.write(PdfReader.getStreamBytes(stream)); 65 | //text.addMouseListener(new StreamEditorAction(stream)); 66 | } 67 | catch(IOException e) { 68 | text.setText("The stream could not be read: " + e.getMessage()); 69 | } 70 | } 71 | else { 72 | update(null, null); 73 | return; 74 | } 75 | text.repaint(); 76 | repaint(); 77 | } 78 | 79 | /** a serial version id. */ 80 | private static final long serialVersionUID = 1302283071087762494L; 81 | 82 | } 83 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/XfaTextArea.java: -------------------------------------------------------------------------------- 1 | package com.lowagie.rups.view.itext; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.swing.JScrollPane; 6 | import javax.swing.JTextArea; 7 | 8 | import com.lowagie.rups.io.OutputStreamResource; 9 | import com.lowagie.rups.io.TextAreaOutputStream; 10 | 11 | /** 12 | * TextArea that visualizes the XFA XML file. 13 | */ 14 | public class XfaTextArea extends JScrollPane { 15 | 16 | /** The text area with the content stream. */ 17 | protected JTextArea text; 18 | 19 | /** 20 | * Constructs a StreamTextArea. 21 | */ 22 | public XfaTextArea() { 23 | super(); 24 | text = new JTextArea(); 25 | setViewportView(text); 26 | } 27 | 28 | public void clear() { 29 | text.setText(""); 30 | } 31 | 32 | public void load(OutputStreamResource xml) throws IOException { 33 | TextAreaOutputStream stream = new TextAreaOutputStream(text); 34 | xml.writeTo(stream); 35 | } 36 | 37 | /** A Serial Version UID. */ 38 | private static final long serialVersionUID = -8275229961781669457L; 39 | } 40 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/XfaTree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: XfaTree.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext; 22 | 23 | import javax.swing.JTree; 24 | import javax.swing.tree.DefaultTreeModel; 25 | 26 | import com.lowagie.rups.model.XfaFile; 27 | import com.lowagie.rups.view.icons.IconTreeCellRenderer; 28 | import com.lowagie.rups.view.icons.IconTreeNode; 29 | import com.lowagie.rups.view.itext.treenodes.XdpTreeNode; 30 | 31 | /** 32 | * Tree that visualizes the XFA information. 33 | */ 34 | public class XfaTree extends JTree { 35 | 36 | /** 37 | * Constructs an XfaTree. 38 | */ 39 | public XfaTree() { 40 | super(); 41 | } 42 | 43 | public void clear() { 44 | setCellRenderer(new IconTreeCellRenderer()); 45 | setModel(new DefaultTreeModel(new IconTreeNode("xfa.png"))); 46 | } 47 | public void load(XfaFile file) { 48 | setCellRenderer(new IconTreeCellRenderer()); 49 | setModel(new DefaultTreeModel(new XdpTreeNode(file.getXfaDocument()))); 50 | } 51 | 52 | /** A Serial Version UID. */ 53 | private static final long serialVersionUID = -5072971223015095193L; 54 | 55 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/treenodes/FormTreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: FormTreeNode.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext.treenodes; 22 | 23 | import com.lowagie.rups.view.icons.IconTreeNode; 24 | import com.lowagie.text.pdf.PdfDictionary; 25 | import com.lowagie.text.pdf.PdfName; 26 | import com.lowagie.text.pdf.PdfObject; 27 | 28 | /** 29 | * A FormTreeNode is a standard node in a FormTree. 30 | */ 31 | public class FormTreeNode extends IconTreeNode { 32 | 33 | /** The corresponding tree node in the PdfTree. */ 34 | protected PdfObjectTreeNode object_node; 35 | 36 | /** 37 | * Creates the root node of the FormTree. 38 | */ 39 | public FormTreeNode() { 40 | super("form.png", "Form"); 41 | } 42 | 43 | /** 44 | * Creates a node corresponding with a node in the PdfTree. 45 | * @param node a corresponding node 46 | */ 47 | public FormTreeNode(PdfObjectTreeNode node) { 48 | super("form.png"); 49 | this.object_node = node; 50 | if (node.isDictionary()) { 51 | PdfDictionary dict = (PdfDictionary)node.getPdfObject(); 52 | PdfObject fieldname = dict.get(PdfName.T); 53 | if (fieldname != null) { 54 | this.setUserObject(fieldname); 55 | } 56 | else { 57 | this.setUserObject("unnamed field"); 58 | } 59 | } 60 | } 61 | 62 | /** 63 | * Gets the node in the PdfTree that corresponds with this 64 | * FormTreeNode. 65 | * @return a PdfObjectTreeNode in the PdfTree 66 | */ 67 | public PdfObjectTreeNode getCorrespondingPdfObjectNode() { 68 | return object_node; 69 | } 70 | 71 | /** A serial version UID. */ 72 | private static final long serialVersionUID = 7800080437550790989L; 73 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/treenodes/OutlineTreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: OutlineTreeNode.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext.treenodes; 22 | 23 | import com.lowagie.rups.view.icons.IconTreeNode; 24 | import com.lowagie.text.pdf.PdfDictionary; 25 | import com.lowagie.text.pdf.PdfName; 26 | 27 | /** 28 | * A node in the OutlineTree. 29 | */ 30 | public class OutlineTreeNode extends IconTreeNode { 31 | 32 | /** The corresponding tree node in the PdfTree. */ 33 | protected PdfObjectTreeNode object_node; 34 | 35 | /** Creates the root node for the OutlineTree. */ 36 | public OutlineTreeNode() { 37 | super("outline.png", "Bookmarks"); 38 | } 39 | 40 | /** 41 | * Creates a node corresponding with a node in the PdfTree. 42 | * @param node a corresponding node 43 | */ 44 | public OutlineTreeNode(PdfObjectTreeNode node) { 45 | super("outline.png"); 46 | this.object_node = node; 47 | PdfDictionary dict = (PdfDictionary)node.getPdfObject(); 48 | this.setUserObject(dict.get(PdfName.TITLE)); 49 | } 50 | 51 | /** 52 | * Gets the node in the PdfTree that corresponds with this 53 | * OutlineTreeNode. 54 | * @return a PdfObjectTreeNode in the PdfTree 55 | */ 56 | public PdfObjectTreeNode getCorrespondingPdfObjectNode() { 57 | return object_node; 58 | } 59 | 60 | /** A serial version uid */ 61 | private static final long serialVersionUID = 5437651809665762952L; 62 | } -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/treenodes/PdfPageTreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfPageTreeNode.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext.treenodes; 22 | 23 | import com.lowagie.text.pdf.PdfDictionary; 24 | 25 | /** 26 | * A tree node corresponding with a Page dictionary in a PDF file. 27 | */ 28 | public class PdfPageTreeNode extends PdfObjectTreeNode { 29 | /** 30 | * Creates a tree node for a Pages dictionary. 31 | * @param object a PdfDictionary of type pages. 32 | */ 33 | public PdfPageTreeNode(PdfDictionary object) { 34 | super("page.png", object); 35 | } 36 | 37 | /** A serial version uid */ 38 | private static final long serialVersionUID = 3747496604295843783L; 39 | } 40 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/treenodes/PdfPagesTreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfPagesTreeNode.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext.treenodes; 22 | 23 | import com.lowagie.text.pdf.PdfDictionary; 24 | 25 | /** 26 | * A tree node corresponding with a Pages dictionary in a PDF file. 27 | */ 28 | public class PdfPagesTreeNode extends PdfObjectTreeNode { 29 | /** 30 | * Creates a tree node for a Pages dictionary. 31 | * @param object a PdfDictionary of type pages. 32 | */ 33 | public PdfPagesTreeNode(PdfDictionary object) { 34 | super("pages.png", object); 35 | } 36 | 37 | /** a serial version uid */ 38 | private static final long serialVersionUID = 4527774449030791503L; 39 | } 40 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/itext/treenodes/PdfTrailerTreeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfTrailerTreeNode.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.itext.treenodes; 22 | 23 | import com.lowagie.text.pdf.PdfDictionary; 24 | 25 | /** 26 | * A special treenode that will be used for the trailer dictionary 27 | * of a PDF file. 28 | */ 29 | public class PdfTrailerTreeNode extends PdfObjectTreeNode { 30 | 31 | /** 32 | * Constructs a simple text tree node. 33 | */ 34 | public PdfTrailerTreeNode() { 35 | super("pdf.png", null); 36 | setUserObject("Open a PDF file"); 37 | } 38 | 39 | /** 40 | * Sets the object for this node. 41 | * @param trailer the trailer dictionary of a PDF file. 42 | */ 43 | public void setTrailer(PdfDictionary trailer) { 44 | object = trailer; 45 | } 46 | 47 | /** A serial version id. */ 48 | private static final long serialVersionUID = -3607980103983635182L; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/models/DictionaryTableModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: DictionaryTableModel.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.models; 22 | 23 | import java.util.ArrayList; 24 | import java.util.Iterator; 25 | 26 | import javax.swing.table.AbstractTableModel; 27 | 28 | import com.lowagie.text.pdf.PdfDictionary; 29 | import com.lowagie.text.pdf.PdfName; 30 | 31 | /** 32 | * A TableModel in case we want to show a PDF dictionary in a JTable. 33 | */ 34 | public class DictionaryTableModel extends AbstractTableModel { 35 | 36 | /** A serial version UID. */ 37 | private static final long serialVersionUID = -8835275996639701776L; 38 | /** The PDF dictionary. */ 39 | protected PdfDictionary dictionary; 40 | /** An ArrayList with the dictionary keys. */ 41 | protected ArrayList keys = new ArrayList(); 42 | 43 | /** 44 | * Creates the TableModel. 45 | * @param dictionary the dictionary we want to show 46 | */ 47 | public DictionaryTableModel(PdfDictionary dictionary) { 48 | this.dictionary = dictionary; 49 | for (Iterator i = dictionary.getKeys().iterator(); i.hasNext(); ) 50 | this.keys.add((PdfName) i.next()); 51 | } 52 | 53 | /** 54 | * @see javax.swing.table.TableModel#getColumnCount() 55 | */ 56 | public int getColumnCount() { 57 | return 2; 58 | } 59 | 60 | /** 61 | * @see javax.swing.table.TableModel#getRowCount() 62 | */ 63 | public int getRowCount() { 64 | return dictionary.size(); 65 | } 66 | 67 | /** 68 | * @see javax.swing.table.TableModel#getValueAt(int, int) 69 | */ 70 | public Object getValueAt(int rowIndex, int columnIndex) { 71 | switch (columnIndex) { 72 | case 0: 73 | return keys.get(rowIndex); 74 | case 1: 75 | return dictionary.get(keys.get(rowIndex)); 76 | default: 77 | return null; 78 | } 79 | } 80 | 81 | /** 82 | * @see javax.swing.table.AbstractTableModel#getColumnName(int) 83 | */ 84 | public String getColumnName(int columnIndex) { 85 | switch (columnIndex) { 86 | case 0: 87 | return "Key"; 88 | case 1: 89 | return "Value"; 90 | default: 91 | return null; 92 | } 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/models/JTableAutoModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: JTableAutoModel.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.models; 22 | 23 | import javax.swing.table.AbstractTableModel; 24 | 25 | /** 26 | * A reusable TableModel class for tables that implement the 27 | * JTableAutoModelInterface. 28 | */ 29 | public class JTableAutoModel extends AbstractTableModel { 30 | 31 | /** The serial version uid. */ 32 | private static final long serialVersionUID = -2229431581745521537L; 33 | /** The table that knows how to model itself. */ 34 | protected JTableAutoModelInterface table; 35 | 36 | /** 37 | * Constructs an auto model for a JTable. 38 | * @param table a JTable that knows information about its model. 39 | */ 40 | public JTableAutoModel(JTableAutoModelInterface table) { 41 | this.table = table; 42 | } 43 | 44 | /** 45 | * @see javax.swing.table.TableModel#getColumnCount() 46 | * @return int the number of columns 47 | */ 48 | public int getColumnCount() { 49 | return table.getColumnCount(); 50 | } 51 | 52 | /** 53 | * @see javax.swing.table.TableModel#getRowCount() 54 | * @return int the number of rows 55 | */ 56 | public int getRowCount() { 57 | return table.getRowCount(); 58 | } 59 | 60 | /** 61 | * @see javax.swing.table.AbstractTableModel#getColumnName(int) 62 | * @param columnIndex a column number. 63 | * @return the name of the column 64 | */ 65 | public String getColumnName(int columnIndex) { 66 | return table.getColumnName(columnIndex); 67 | } 68 | 69 | /** 70 | * @see javax.swing.table.TableModel#getValueAt(int, int) 71 | * @param rowIndex int a row number 72 | * @param columnIndex int a column number 73 | * @return Object an object corresponding with a cell in the table 74 | */ 75 | public Object getValueAt(int rowIndex, int columnIndex) { 76 | return table.getValueAt(rowIndex, columnIndex); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/models/JTableAutoModelInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: JTableAutoModelInterface.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.models; 22 | 23 | /** 24 | * Tables that contain the information necessary for creating their model 25 | * should implement this interface, so that they can use the JTableAutoModel 26 | * class as TableModel. 27 | */ 28 | public interface JTableAutoModelInterface { 29 | /** 30 | * @see javax.swing.table.TableModel#getColumnCount() 31 | * @return int the number of columns 32 | */ 33 | public int getColumnCount(); 34 | /** 35 | * @see javax.swing.table.TableModel#getRowCount() 36 | * @return int the number of rows 37 | */ 38 | public int getRowCount(); 39 | /** 40 | * @see javax.swing.table.AbstractTableModel#getColumnName(int) 41 | * @param columnIndex a column number. 42 | * @return the name of the column 43 | */ 44 | public String getColumnName(int columnIndex); 45 | /** 46 | * @see javax.swing.table.TableModel#getValueAt(int, int) 47 | * @param rowIndex int a row number 48 | * @param columnIndex int a column number 49 | * @return Object an object corresponding with a cell in the table 50 | */ 51 | public Object getValueAt(int rowIndex, int columnIndex); 52 | } 53 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/models/PdfArrayTableModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfArrayTableModel.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.models; 22 | 23 | import javax.swing.table.AbstractTableModel; 24 | 25 | import com.lowagie.text.pdf.PdfArray; 26 | 27 | /** 28 | * A TableModel in case we want to show a PDF array in a JTable. 29 | */ 30 | public class PdfArrayTableModel extends AbstractTableModel { 31 | 32 | /** A serial version UID. */ 33 | private static final long serialVersionUID = 4665485782853993708L; 34 | /** The PDF array. */ 35 | protected PdfArray array; 36 | 37 | /** 38 | * Creates the TableModel. 39 | * @param array a PDF array 40 | */ 41 | public PdfArrayTableModel(PdfArray array) { 42 | this.array = array; 43 | } 44 | 45 | /** 46 | * @see javax.swing.table.TableModel#getColumnCount() 47 | */ 48 | public int getColumnCount() { 49 | return 1; 50 | } 51 | 52 | /** 53 | * @see javax.swing.table.TableModel#getRowCount() 54 | */ 55 | public int getRowCount() { 56 | return array.size(); 57 | } 58 | 59 | /** 60 | * @see javax.swing.table.TableModel#getValueAt(int, int) 61 | */ 62 | public Object getValueAt(int rowIndex, int columnIndex) { 63 | switch (columnIndex) { 64 | case 0: 65 | return array.getPdfObject(rowIndex); 66 | default: 67 | return null; 68 | } 69 | } 70 | 71 | /** 72 | * @see javax.swing.table.AbstractTableModel#getColumnName(int) 73 | */ 74 | public String getColumnName(int columnIndex) { 75 | switch (columnIndex) { 76 | case 0: 77 | return "Array"; 78 | default: 79 | return null; 80 | } 81 | } 82 | 83 | } 84 | 85 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/renderer/PageField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PageField.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.renderer; 22 | 23 | import java.awt.Dimension; 24 | import java.awt.event.ActionEvent; 25 | import java.awt.event.ActionListener; 26 | 27 | import javax.swing.JTextField; 28 | 29 | import com.lowagie.rups.view.PageNavigationListener; 30 | 31 | /** 32 | * A field that can be used to fill in a number of a page that has 33 | * to be rendered. 34 | */ 35 | public class PageField extends JTextField implements ActionListener { 36 | 37 | /** An object that listens to page change events. */ 38 | protected PageNavigationListener listener; 39 | 40 | /** 41 | * Creates the page field. 42 | * @param listener the object that listens to page navigation changes. 43 | */ 44 | public PageField(PageNavigationListener listener) { 45 | super("", 5); 46 | this.listener = listener; 47 | setMaximumSize(new Dimension(45, 32)); 48 | addActionListener(this); 49 | } 50 | 51 | /** 52 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 53 | */ 54 | public void actionPerformed(ActionEvent evt) { 55 | int pageNumber; 56 | try { 57 | pageNumber = Integer.parseInt(getText()); 58 | } catch (NumberFormatException nfe) { 59 | pageNumber = -1; 60 | } 61 | listener.gotoPage(pageNumber); 62 | } 63 | 64 | /** A Serial Version UID. */ 65 | private static final long serialVersionUID = 8212776141917597892L; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /rups/com/lowagie/rups/view/renderer/ToolBar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: ToolBar.java 3117 2008-01-31 05:53:22Z xlv $ 3 | * 4 | * Copyright 2007 Bruno Lowagie. 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.lowagie.rups.view.renderer; 22 | 23 | import javax.swing.Box; 24 | import javax.swing.JToolBar; 25 | 26 | import com.lowagie.rups.view.PageNavigationAction; 27 | import com.lowagie.rups.view.PageNavigationListener; 28 | import com.lowagie.rups.view.icons.IconButton; 29 | 30 | /** 31 | * The Tool Bar that will be used to navigate from page to page 32 | * and change the way a page is rendered. 33 | */ 34 | public class ToolBar extends JToolBar { 35 | 36 | /** the current page number text field */ 37 | protected PageField pageField; 38 | 39 | /** 40 | * Creates the tool bar. 41 | * @param listener an object that is listening to page navigation changes. 42 | */ 43 | public ToolBar(PageNavigationListener listener) { 44 | super(); 45 | pageField = new PageField(listener); 46 | 47 | setFloatable(false); 48 | add(Box.createHorizontalGlue()); 49 | addNavigationButton(listener, PageNavigationAction.FIRST_PAGE); 50 | addNavigationButton(listener, PageNavigationAction.PREVIOUS_PAGE); 51 | add(pageField); 52 | addNavigationButton(listener, PageNavigationAction.NEXT_PAGE); 53 | addNavigationButton(listener, PageNavigationAction.LAST_PAGE); 54 | } 55 | 56 | /** 57 | * Changes the page number in the page field. 58 | * @param pageNumber the number of the currently shown page 59 | */ 60 | public void setPageNumber(int pageNumber) { 61 | if (pageNumber > 0) { 62 | pageField.setText(String.valueOf(pageNumber)); 63 | } 64 | else { 65 | pageField.setText(""); 66 | } 67 | } 68 | 69 | /** 70 | * Convenience method to create navigation buttons. 71 | * @param listener a page navigation listener 72 | * @param type a type of page navigation 73 | */ 74 | protected void addNavigationButton(PageNavigationListener listener, int type) { 75 | add(new IconButton(new PageNavigationAction(listener, type, true))); 76 | } 77 | 78 | /** A Serial Version UID. */ 79 | private static final long serialVersionUID = -2062747250230455558L; 80 | 81 | } -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/1t3xt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/toolbox/com/lowagie/toolbox/1t3xt.gif -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/ToolMenuItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: ToolMenuItems.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This code was originally published under the MPL by Bruno Lowagie. 29 | * It was a part of iText, a Java-PDF library. You can now use it under 30 | * the MIT License; for backward compatibility you can also use it under 31 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 32 | * A copy of the MPL license is bundled with the source code FYI. 33 | */ 34 | 35 | package com.lowagie.toolbox; 36 | 37 | /** 38 | * Keeps all the possible menuitems. 39 | * @since 2.1.1 (imported from itexttoolbox project) 40 | */ 41 | public class ToolMenuItems { 42 | 43 | /** An item in the menubar. */ 44 | public static final String FILE = "File"; 45 | /** An item in the menubar. */ 46 | public static final String CLOSE = "Close"; 47 | /** An item in the menubar. */ 48 | public static final String TOOLS = "Tools"; 49 | public static final String FILELIST = "Filelist"; 50 | public static final String VIEW = "View"; 51 | public static final String RESET = "Reset"; 52 | /** An item in the menubar. */ 53 | public static final String HELP = "Help"; 54 | /** An item in the menubar. */ 55 | public static final String VERSION = "Version"; 56 | /** An item in the menubar. */ 57 | public static final String ABOUT = "About"; 58 | /** An item in the menubar. */ 59 | public static final String TOOL = "Tool"; 60 | /** An item in the menubar. */ 61 | public static final String USAGE = "Usage"; 62 | /** An item in the menubar. */ 63 | public static final String ARGUMENTS = "Arguments"; 64 | /** An item in the menubar. */ 65 | public static final String EXECUTE = "Execute"; 66 | /** An item in the menubar. */ 67 | public static final String EXECUTESHOW = "Execute+Open"; 68 | /** An item in the menubar. */ 69 | public static final String EXECUTEPRINT = "Execute+Printdialog"; 70 | /** An item in the menubar. */ 71 | public static final String EXECUTEPRINTSILENT = "Execute+Print"; 72 | 73 | } 74 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/ColorArgument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: ColorArgument.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie, Carsten Hammer 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Carsten Hammer. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | package com.lowagie.toolbox.arguments; 36 | 37 | import java.awt.Color; 38 | import java.awt.event.ActionEvent; 39 | 40 | import javax.swing.JColorChooser; 41 | 42 | import com.lowagie.toolbox.AbstractTool; 43 | 44 | /** 45 | * @since 2.1.1 (imported from itexttoolbox project) 46 | */ 47 | public class ColorArgument extends AbstractArgument { 48 | public ColorArgument() { 49 | super(); 50 | } 51 | 52 | public ColorArgument(AbstractTool tool, String name, String description) { 53 | super(tool, name, description, null); 54 | } 55 | 56 | public Object getArgument() throws InstantiationException { 57 | if (value == null) { 58 | return null; 59 | } 60 | try { 61 | return Color.decode(value.toString()); 62 | } catch (Exception e) { 63 | throw new InstantiationException(e.getMessage()); 64 | } 65 | } 66 | 67 | public void actionPerformed(ActionEvent e) { 68 | Color initialColor = new Color(0xFF, 0xFF, 0xFF); 69 | if (value != null) { 70 | initialColor = Color.decode(value.toString()); 71 | } 72 | Color newColor = JColorChooser.showDialog(tool.getInternalFrame(), 73 | "Choose Color", initialColor); 74 | setValue("0x" 75 | + Integer.toHexString( 76 | (newColor.getRed() << 16) 77 | | (newColor.getGreen() << 8) 78 | | (newColor.getBlue() << 0)).toUpperCase()); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/FloatArgument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: FloatArgument.java 3297 2008-05-01 12:19:24Z blowagie $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie, Carsten Hammer 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Carsten Hammer. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | package com.lowagie.toolbox.arguments; 36 | 37 | import java.awt.event.ActionEvent; 38 | 39 | import com.lowagie.toolbox.AbstractTool; 40 | import com.lowagie.toolbox.swing.CustomDialog; 41 | 42 | /** 43 | * @since 2.1.1 (imported from itexttoolbox project) 44 | */ 45 | public class FloatArgument extends AbstractArgument { 46 | public FloatArgument() { 47 | super(); 48 | } 49 | 50 | public FloatArgument(AbstractTool tool, String name, String description) { 51 | super(tool, name, description, null); 52 | } 53 | 54 | /** 55 | * Invoked when an action occurs. 56 | * 57 | * @param e ActionEvent 58 | */ 59 | public void actionPerformed(ActionEvent e) { 60 | CustomDialog cd=new CustomDialog("Enter a value for " + name + 61 | ":",CustomDialog.instantiateFloatDocument()); 62 | setValue(cd.showInputDialog(this.getValue()==null?"0":this.getValue().toString())); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/IntegerArgument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: IntegerArgument.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie, Carsten Hammer 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Carsten Hammer. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | 36 | package com.lowagie.toolbox.arguments; 37 | 38 | import java.awt.event.ActionEvent; 39 | 40 | import com.lowagie.toolbox.AbstractTool; 41 | import com.lowagie.toolbox.swing.CustomDialog; 42 | 43 | /** 44 | * This is an argument of one of the tools in the toolbox. 45 | * @since 2.1.1 (imported from itexttoolbox project) 46 | */ 47 | public class IntegerArgument extends AbstractArgument { 48 | 49 | /** Constructs a IntegerArgument. */ 50 | public IntegerArgument() { 51 | } 52 | 53 | /** 54 | * Constructs a IntegerArgument. 55 | * 56 | * @param tool 57 | * the tool that needs this argument 58 | * @param name 59 | * the name of the argument 60 | * @param description 61 | * the description of the argument 62 | */ 63 | public IntegerArgument(AbstractTool tool, String name, String description) { 64 | super(tool, name, description, null); 65 | } 66 | 67 | /** 68 | * 69 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 70 | * @param e ActionEvent 71 | */ 72 | public void actionPerformed(ActionEvent e) { 73 | CustomDialog cd = new CustomDialog("Enter a value for " + name + 74 | ":", 75 | CustomDialog.instantiateIntegerDocument()); 76 | setValue(cd.showInputDialog(this.getValue()==null?"0":this.getValue().toString())); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/StringArgument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: StringArgument.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie, Carsten Hammer 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Carsten Hammer. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | 36 | package com.lowagie.toolbox.arguments; 37 | 38 | import java.awt.event.ActionEvent; 39 | 40 | import com.lowagie.toolbox.AbstractTool; 41 | import com.lowagie.toolbox.swing.CustomDialog; 42 | 43 | /** 44 | * This is an argument of one of the tools in the toolbox. 45 | * @since 2.1.1 (imported from itexttoolbox project) 46 | */ 47 | public class StringArgument extends AbstractArgument { 48 | 49 | /** Constructs a StringArgument. */ 50 | public StringArgument() { 51 | } 52 | 53 | /** 54 | * Constructs a StringArgument. 55 | * 56 | * @param tool 57 | * the tool that needs this argument 58 | * @param name 59 | * the name of the argument 60 | * @param description 61 | * the description of the argument 62 | */ 63 | public StringArgument(AbstractTool tool, String name, String description) { 64 | super(tool, name, description, null); 65 | } 66 | 67 | /** 68 | * 69 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 70 | * @param e ActionEvent 71 | */ 72 | public void actionPerformed(ActionEvent e) { 73 | CustomDialog cd = new CustomDialog("Enter a value for " + name + 74 | ":", 75 | CustomDialog. 76 | instantiateStringDocument()); 77 | setValue(cd.showInputDialog(this.getValue()==null?"":this.getValue().toString())); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/filters/DirFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: DirFilter.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 by Johannes Schindelin 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Johannes Schindelin. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | 36 | package com.lowagie.toolbox.arguments.filters; 37 | 38 | import java.io.File; 39 | 40 | import javax.swing.filechooser.FileFilter; 41 | 42 | /** 43 | * Filters directories in a JFileChooser. 44 | * @since 2.1.1 (imported from itexttoolbox project) 45 | */ 46 | public class DirFilter extends FileFilter { 47 | 48 | /** 49 | * 50 | * @see javax.swing.filechooser.FileFilter#accept(java.io.File) 51 | * @param f File 52 | * @return boolean 53 | */ 54 | public boolean accept(File f) { 55 | if (f.isDirectory()) return true; 56 | return false; 57 | } 58 | 59 | /** 60 | * 61 | * @see javax.swing.filechooser.FileFilter#getDescription() 62 | * @return String 63 | */ 64 | public String getDescription() { 65 | return "directories"; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/filters/PdfFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PdfFilter.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie, Carsten Hammer 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Carsten Hammer. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | 36 | package com.lowagie.toolbox.arguments.filters; 37 | 38 | import java.io.File; 39 | 40 | import javax.swing.filechooser.FileFilter; 41 | 42 | /** 43 | * Filters PDF files in a JFileChooser. 44 | * @since 2.1.1 (imported from itexttoolbox project) 45 | */ 46 | public class PdfFilter extends FileFilter { 47 | 48 | /** 49 | * 50 | * @see javax.swing.filechooser.FileFilter#accept(java.io.File) 51 | * @param f File 52 | * @return boolean 53 | */ 54 | public boolean accept(File f) { 55 | if (f.isDirectory()) return true; 56 | if (f.getName().toLowerCase().endsWith(".pdf")) return true; 57 | return false; 58 | } 59 | 60 | /** 61 | * 62 | * @see javax.swing.filechooser.FileFilter#getDescription() 63 | * @return String 64 | */ 65 | public String getDescription() { 66 | return "*.pdf PDF files"; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/arguments/filters/U3DFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: U3DFilter.java 3271 2008-04-18 20:39:42Z xlv $ 3 | * Copyright (c) 2005-2007 Bruno Lowagie, Carsten Hammer 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | /* 28 | * This class was originally published under the MPL by Bruno Lowagie 29 | * and Carsten Hammer. 30 | * It was a part of iText, a Java-PDF library. You can now use it under 31 | * the MIT License; for backward compatibility you can also use it under 32 | * the MPL version 1.1: http://www.mozilla.org/MPL/ 33 | * A copy of the MPL license is bundled with the source code FYI. 34 | */ 35 | 36 | package com.lowagie.toolbox.arguments.filters; 37 | 38 | import java.io.File; 39 | 40 | import javax.swing.filechooser.FileFilter; 41 | 42 | /** 43 | * Filters U3D files in a JFileChooser. 44 | * @since 2.1.1 (imported from itexttoolbox project) 45 | */ 46 | public class U3DFilter extends FileFilter { 47 | 48 | /** 49 | * 50 | * @see javax.swing.filechooser.FileFilter#accept(java.io.File) 51 | * @param f File 52 | * @return boolean 53 | */ 54 | public boolean accept(File f) { 55 | if (f.isDirectory()) return true; 56 | if (f.getName().toLowerCase().endsWith(".u3d")) return true; 57 | return false; 58 | } 59 | 60 | /** 61 | * 62 | * @see javax.swing.filechooser.FileFilter#getDescription() 63 | * @return String 64 | */ 65 | public String getDescription() { 66 | return "*.u3d U3D files"; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/plugins/rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/toolbox/com/lowagie/toolbox/plugins/rotate.png -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/plugins/translate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/toolbox/com/lowagie/toolbox/plugins/translate.png -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/plugins/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwinkler/itext2/c12bb3be68ae30c01dcd5c34271cd7e743f4f1df/toolbox/com/lowagie/toolbox/plugins/zoom.png -------------------------------------------------------------------------------- /toolbox/com/lowagie/toolbox/tools.txt: -------------------------------------------------------------------------------- 1 | # This is a list of tools that are available for the iText toolbox 2 | # $Id: tools.txt 3277 2008-04-19 00:47:48Z xlv $ 3 | 4 | # Made by Bruno Lowagie: 5 | 6 | Bookmarks.Bookmarks2XML: com.lowagie.toolbox.plugins.Bookmarks2XML 7 | Manipulate.Burst: com.lowagie.toolbox.plugins.Burst 8 | Manipulate.Watermarker: com.lowagie.toolbox.plugins.Watermarker 9 | Manipulate.CompressDecompress: com.lowagie.toolbox.plugins.CompressDecompressPageContent 10 | Manipulate.Concat: com.lowagie.toolbox.plugins.Concat 11 | Encryption.Decrypt: com.lowagie.toolbox.plugins.Decrypt 12 | Manipulate.Divide: com.lowagie.toolbox.plugins.Divide 13 | Various.DvdCover: com.lowagie.toolbox.plugins.DvdCover 14 | Encryption.Encrypt: com.lowagie.toolbox.plugins.Encrypt 15 | Various.ExtractAttachments: com.lowagie.toolbox.plugins.ExtractAttachments 16 | Various.Handouts: com.lowagie.toolbox.plugins.Handouts 17 | Bookmarks.HtmlBookmarks: com.lowagie.toolbox.plugins.HtmlBookmarks 18 | Properties.ImageXRefViewer: com.lowagie.toolbox.plugins.ImageXRefViewer 19 | Properties.InspectPDF: com.lowagie.toolbox.plugins.InspectPDF 20 | Convert2Pdf.KnitTiff: com.lowagie.toolbox.plugins.KnitTiff 21 | Manipulate.N-up: com.lowagie.toolbox.plugins.NUp 22 | Convert2Pdf.PhotoAlbum: com.lowagie.toolbox.plugins.PhotoAlbum 23 | Various.RemoveLaunchApplication: com.lowagie.toolbox.plugins.RemoveLaunchApplication 24 | Manipulate.ReversePages: com.lowagie.toolbox.plugins.ReversePages 25 | Manipulate.SelectedPages: com.lowagie.toolbox.plugins.SelectedPages 26 | Manipulate.Split: com.lowagie.toolbox.plugins.Split 27 | Convert2Pdf.Tiff2Pdf: com.lowagie.toolbox.plugins.Tiff2Pdf 28 | Convert2Pdf.Txt2Pdf: com.lowagie.toolbox.plugins.Txt2Pdf 29 | Bookmarks.XML2Bookmarks: com.lowagie.toolbox.plugins.XML2Bookmarks 30 | Manipulate.Normalize: com.lowagie.toolbox.plugins.Normalize 31 | Manipulate.Add3D: com.lowagie.toolbox.plugins.Add3D 32 | --------------------------------------------------------------------------------