├── README.md ├── Spire.Barcode ├── GUI │ └── Barcode_GUI_Samples.jar ├── generate │ ├── AZTEC.java │ ├── CODABAR.java │ ├── CODE_11.java │ ├── CODE_128.java │ ├── CODE_25.java │ ├── CODE_39.java │ ├── CODE_39_EXTENDED.java │ ├── CODE_93.java │ ├── CODE_93_EXTENDED.java │ ├── DATA_MATRIX.java │ ├── DEUTSCHE_POST_IDENTCODE.java │ ├── DEUTSCHE_POST_LEITCODE.java │ ├── EAN_128.java │ ├── EAN_13.java │ ├── EAN_14.java │ ├── EAN_8.java │ ├── INTERLEAVED_25.java │ ├── ITF_14.java │ ├── ITF_6.java │ ├── MSI.java │ ├── OPC.java │ ├── PDF_417.java │ ├── PDF_417_MACRO.java │ ├── PLANET.java │ ├── POST_NET.java │ ├── PZN.java │ ├── QR_CODE.java │ ├── ROYAL_MAIL_4_STATE.java │ ├── RSS_14.java │ ├── RSS_14_TRUNCATED.java │ ├── RSS_EXPANDED.java │ ├── RSS_LIMITED.java │ ├── SCC_14.java │ ├── SINGAPORE_POST_4_STATE.java │ ├── SSCC_18.java │ ├── SWISS_POST_PARCEL.java │ ├── UPCA.java │ ├── UPCE.java │ └── USPS.java └── scan │ └── Scan.java ├── Spire.Doc ├── 01_quickGuide │ └── helloWorld.java ├── 02_findAndReplace │ ├── findAndHighlight.java │ ├── getText.java │ ├── replaceTextByRegex.java │ ├── replaceWithHtml.java │ └── replaceWithText.java ├── 03_formatting │ ├── characterFormatting.java │ ├── lists.java │ ├── paragraphFormatting.java │ └── styles.java ├── 04_content │ ├── addContentControls.java │ ├── bookmarks │ │ ├── copyBookmarkContent.java │ │ ├── createBookmark.java │ │ ├── removeBookmark.java │ │ ├── removeBookmarkContent.java │ │ └── replaceBookmarkContent.java │ ├── comments │ │ ├── comment.java │ │ └── replyToComment.java │ ├── extractImage.java │ ├── footnotes │ │ ├── insertEndnote.java │ │ ├── insertFootnote.java │ │ └── removeFootnote.java │ ├── headerAndFooter.java │ ├── hyperlink.java │ ├── image.java │ ├── ole │ │ ├── extractOLE.java │ │ └── insertOLE.java │ ├── setImageBackground.java │ ├── table │ │ ├── addOrDeleteRow.java │ │ ├── autoFitToContents.java │ │ ├── autoFitToFixed.java │ │ ├── autoFitToWindow.java │ │ ├── createTable.java │ │ ├── mergeAndSplitTableCell.java │ │ ├── setColumnWidth.java │ │ └── setTableStyleAndBorder.java │ ├── tableOfContent │ │ ├── createTableOfContentByDefault.java │ │ └── customizeTableOfContent.java │ ├── textBox.java │ └── watermarks │ │ ├── imageWaterMark.java │ │ └── textWaterMark.java ├── 05_conversion │ ├── fromHtml │ │ ├── htmlFileToWord.java │ │ └── htmlStringToWord.java │ ├── toHtml │ │ ├── toHtml.java │ │ └── toHtmlExportOption.java │ ├── toImage.java │ ├── toOdt.java │ ├── toPdf │ │ ├── embedAllFontsInPDF.java │ │ ├── embedNoninstalledFonts.java │ │ ├── preserveWordBookmarks.java │ │ ├── specifyEmbeddedFont.java │ │ ├── toPDF.java │ │ └── toPdfWithPassword.java │ ├── toRtf.java │ ├── toSVG.java │ ├── toXML.java │ └── toXPS.java ├── 06_protect │ ├── decrypt.java │ └── encrypt.java ├── 07_mailMerge │ ├── hideEmptyRegions.java │ ├── mailMerge.java │ ├── mailMergeImage.java │ ├── mergeEventHandler.java │ └── nestedMailMerge.java ├── 08_misc │ ├── insertBreak.java │ └── merge.java ├── 09_setUp │ ├── documentProperty.java │ └── pageSetup.java ├── 10_formField │ ├── createFormField.java │ ├── fillFormField.java │ └── handleAskField.java ├── 11_macros │ └── macros.java ├── 12_print │ └── print.java ├── 13_shape │ ├── addShapeGroup.java │ ├── addShapes.java │ └── insertWordArt.java └── data │ ├── Lucida Sans Unicode.ttf │ ├── Summary_of_Science.doc │ ├── background.png │ ├── bookmark.docx │ ├── comment.docx │ ├── convertedTemplate.docx │ ├── decrypt.docx │ ├── encrypt.docx │ ├── example.xlsx │ ├── excel.png │ ├── extractImage.docx │ ├── extractOLE.docx │ ├── fillFormField.doc │ ├── findAndHighlight.docx │ ├── footer.png │ ├── form.xml │ ├── getText.docx │ ├── handleAskField.docx │ ├── header.png │ ├── headerAndFooter.docx │ ├── hideEmptyRegions.doc │ ├── htmlFileToWord.html │ ├── hyacinths.JPG │ ├── imageWatermark.png │ ├── insertEndnote.doc │ ├── insertFootnote.docx │ ├── insertWordArt.docx │ ├── logo.png │ ├── macros.docm │ ├── mailMerge.doc │ ├── mailMergeImage.docx │ ├── mailMergedImage.png │ ├── merge1.doc │ ├── merge2.docx │ ├── mergeEventHandler.doc │ ├── mergeEventHandler.docx │ ├── nestedMailMerge.doc │ ├── orders.xml │ ├── ornithogalum.jpg │ ├── preserveWordBookmarks.doc │ ├── print.docx │ ├── removeFootnote.docx │ ├── replaceTextByRegex.docx │ ├── replaceWithHtml.docx │ ├── replaceWithHtml.txt │ ├── replaceWithText.docx │ ├── replyToComment.docx │ ├── rosa.jpg │ ├── setImageBackground.docx │ ├── spireDoc.png │ ├── tableSample.docx │ ├── toHtmlTemplate.docx │ ├── toOdt.docx │ ├── toXML.doc │ ├── user.xml │ └── watermarkTemplate.doc ├── Spire.Pdf ├── 01_quickGuide │ └── helloWorld.java ├── 02_drawing │ ├── drawBarcode.java │ ├── drawContentWithSpotColor.java │ ├── drawImage.java │ ├── drawShape.java │ ├── drawText.java │ ├── overlay.java │ └── transparency.java ├── 03_formatting │ ├── font.java │ └── textLayout.java ├── 04_page │ ├── deleteImage.java │ ├── deletePage.java │ ├── extraction.java │ ├── findAndHighlightText.java │ ├── getNumberOfPages.java │ ├── headerAndFooter.java │ ├── layers │ │ ├── addLayers.java │ │ └── deleteLayer.java │ ├── pageSetup.java │ ├── pagination.java │ ├── resetPageSize.java │ ├── template.java │ └── transition.java ├── 05_table │ ├── dataSource.java │ ├── imageTable.java │ ├── simpleTable.java │ ├── tableBorder.java │ └── tableLayout.java ├── 06_grid │ ├── changeBorderColor.java │ ├── grid.java │ └── mergeCells.java ├── 07_waterMark │ ├── imageWaterMark.java │ └── textWaterMark.java ├── 08_list │ └── list.java ├── 09_interaction │ ├── action.java │ ├── actionChain.java │ ├── addTableOfContent.java │ ├── annotation │ │ ├── addFreeTextAnnotation.java │ │ ├── annotation.java │ │ └── deleteAnnotation.java │ ├── attachment │ │ ├── attachment.java │ │ └── deleteAllAttachments.java │ ├── bookmark │ │ ├── bookmark.java │ │ ├── deleteBookmark.java │ │ └── updateBookmark.java │ ├── formField │ │ ├── addFormField.java │ │ ├── addTooltipForFormField.java │ │ ├── automaticField.java │ │ ├── deleteFormField.java │ │ ├── determineRequiredField.java │ │ ├── extractJavaScript.java │ │ ├── fillFormField.java │ │ └── flattenFormField.java │ ├── goToAction.java │ ├── link.java │ └── stamp │ │ ├── addImageStamp.java │ │ └── addTextStamp.java ├── 10_securityAndSignatures │ ├── changeSecurityPermission.java │ ├── decryption.java │ ├── digitalSignature.java │ ├── encryption.java │ └── isModifiedSignedPDF.java ├── 11_conversion │ ├── toHTML.java │ ├── toImage.java │ ├── toPDFA.java │ ├── toSVG.java │ ├── toWord.java │ ├── toXPS.java │ └── xpsToPDF.java ├── 12_documentSettings │ ├── properties.java │ └── viewerPreference.java ├── 13_documentOperation │ ├── booklet.java │ ├── changePdfVersion.java │ ├── compressDocument.java │ ├── mergeDocuments.java │ ├── mergePdfsByStream.java │ ├── setXMPMetadata.java │ ├── setZoomFactor.java │ └── splitDocument.java ├── 14_print │ ├── print.java │ ├── printWithCustomizedPageSize.java │ └── showPrintDialog.java ├── data │ ├── Background.png │ ├── E-iceblueLogo.png │ ├── FormField.xml │ ├── Hawaii_Killer.ttf │ ├── SalesReportChart.png │ ├── SciencePersonificationBoston.jpg │ ├── Science_History_and_Etymology.txt │ ├── Summary_of_Science.txt │ ├── Wikipedia_Science.png │ ├── XPStoPDF.xps │ ├── addLayer.pdf │ ├── addTableOfContent.pdf │ ├── addTooltipForFormField.pdf │ ├── booklet.pdf │ ├── changePdfVersion.pdf │ ├── changeSecurityPermission.pdf │ ├── chartImage.png │ ├── compressDocument.pdf │ ├── decryption.pdf │ ├── deleteAllAttachments.pdf │ ├── deleteAnnotation.pdf │ ├── deleteBookmark.pdf │ ├── deleteFormField.pdf │ ├── deleteImage.pdf │ ├── deleteLayer.pdf │ ├── deletePage.pdf │ ├── demo.mdb │ ├── determineRequiredField.pdf │ ├── digitalSignature.pdf │ ├── encryption.pdf │ ├── extractJavaScript.pdf │ ├── extraction.pdf │ ├── fillFormField.pdf │ ├── findAndHighlightText.pdf │ ├── flattenFormField.pdf │ ├── footer.png │ ├── gary.pfx │ ├── getNumberOfPages.pdf │ ├── goToAction.pdf │ ├── header.png │ ├── headerAndFooter.pdf │ ├── image stamp.jpg │ ├── isModifiedSignedPDF.pdf │ ├── mergePdfsTemplate_1.pdf │ ├── mergePdfsTemplate_2.pdf │ ├── mergePdfsTemplate_3.pdf │ ├── overlay1.pdf │ ├── overlay2.pdf │ ├── pdfIcon.jpg │ ├── print.pdf │ ├── properties.pdf │ ├── resetPageSize.pdf │ ├── setXMPMetadata.pdf │ ├── setZoomFactor.pdf │ ├── splitDocument.pdf │ ├── stamp.pdf │ ├── toHTML.pdf │ ├── toImage.pdf │ ├── toPDFA.pdf │ ├── toSVG.pdf │ ├── toWord.pdf │ ├── toXPS.pdf │ ├── updateBookmark.pdf │ ├── viewerPreference.pdf │ └── waterMark.pdf └── util │ └── textUtil.java ├── Spire.Presentation ├── 01_quickGuide │ └── helloWorld.java ├── 02_paragraphAndText │ ├── addWatermark.java │ ├── alignment.java │ ├── appendHTML.java │ ├── bordersAndShading.java │ ├── bullets.java │ ├── changeTextStyle.java │ ├── extractText.java │ ├── hyperlinks.java │ └── indent.java ├── 03_imagesAndShapes │ ├── addShapes.java │ ├── background.java │ ├── embedExcelAsOLE.java │ ├── extractImage.java │ ├── fillShapeWithGradient.java │ ├── fillShapeWithPicture.java │ ├── insertImage.java │ ├── rotateShape.java │ └── shapeToImage.java ├── 04_tableAndChart │ ├── addImageInTableCell.java │ ├── changeTextFontInChart.java │ ├── chartAxis.java │ ├── createBubbleChart.java │ ├── createCombinationChart.java │ ├── createCylinder3DClusteredChart.java │ ├── createDoughnutChart.java │ ├── createScatterChart.java │ ├── createTable.java │ ├── formatChartDataLabels.java │ ├── mergeTableCell.java │ ├── removeRowsAndColumns.java │ ├── saveChartAsImage.java │ ├── setAlignmentInTable.java │ ├── setDatapointColorInChart.java │ ├── setRowHeightColumnWidth.java │ └── setTableStyle.java ├── 05_headerAndFooter │ └── headerAndFooter.java ├── 06_protect │ ├── encrypt.java │ ├── openEncryptedPPT.java │ ├── removeEncyption.java │ └── setDocumentReadOnly.java ├── 07_media │ ├── insertAudio.java │ └── insertVideo.java ├── 08_properties │ ├── markAsFinal.java │ └── properties.java ├── 09_slides │ ├── addImageInMaster.java │ ├── animations.java │ ├── appendSlideWithMasterLayout.java │ ├── changeSlideLayout.java │ ├── changeSlidePosition.java │ ├── cloneSlideToAnotherPPT.java │ ├── createSlide.java │ ├── hideSlide.java │ ├── pageSetup.java │ ├── removeSlide.java │ ├── setBackground.java │ └── setTransitions.java ├── 10_conversion │ ├── toImage.java │ ├── toPDF.java │ ├── toPPTX.java │ └── toSVG.java ├── 11_smartArt │ ├── addSmartArtNode.java │ ├── createSmartArtShape.java │ └── removeNode.java ├── 12_commentAndNote │ ├── addComment.java │ ├── addNote.java │ └── deleteComment.java ├── 13_Print │ └── print.java └── data │ ├── Logo.png │ ├── Music.wav │ ├── Video.mp4 │ ├── Video.png │ ├── addComment.pptx │ ├── addImageInMaster.pptx │ ├── addImageInTableCell.pptx │ ├── addNote.pptx │ ├── addSmartArtNode.pptx │ ├── addWatermark.pptx │ ├── alignment.pptx │ ├── animations.pptx │ ├── appendHTML.pptx │ ├── appendSlideWithMasterLayout.pptx │ ├── backgroundImg.png │ ├── bg.png │ ├── bordersAndShading.pptx │ ├── bulltes.pptx │ ├── changeSlideLayout.pptx │ ├── changeSlidePosition.pptx │ ├── changeTextFontInChart.pptx │ ├── changeTextStyle.pptx │ ├── chartAxis.pptx │ ├── cloneSlideToAnotherPPT-1.pptx │ ├── cloneSlideToAnotherPPT-2.pptx │ ├── createSmartArtShape.pptx │ ├── createTable.pptx │ ├── deleteComment.pptx │ ├── embedExcelAsOLE.png │ ├── embedExcelAsOLE.xlsx │ ├── encrypt.pptx │ ├── extractImage.pptx │ ├── extractText.pptx │ ├── fillShapeWithGradient.pptx │ ├── fillShapeWithPicture.pptx │ ├── formatChartDataLabels.pptx │ ├── headerAndFooter.pptx │ ├── hideSlide.pptx │ ├── indent.pptx │ ├── insertAudio.pptx │ ├── insertImage.png │ ├── insertImage.pptx │ ├── insertVideo.pptx │ ├── markAsFinal.pptx │ ├── mergeTableCell.pptx │ ├── openEncryptedPPT.pptx │ ├── presentationIcon.png │ ├── print.pptx │ ├── properties.pptx │ ├── removeEncyption.pptx │ ├── removeNode.pptx │ ├── removeRowsAndColumns.pptx │ ├── removeSlide.pptx │ ├── rotateShape.pptx │ ├── saveChartAsImage.pptx │ ├── setAlignmentInTable.pptx │ ├── setDatapointColorInChart.pptx │ ├── setDocumentReadOnly.pptx │ ├── setRowHeightColumnWidth.pptx │ ├── setTableStyle.pptx │ ├── setTransitions.pptx │ ├── setbackground.png │ ├── setbackground.pptx │ ├── shapeToImage.pptx │ ├── toImage.pptx │ ├── toPDF.pptx │ ├── toPPTX.ppt │ ├── toSVG.pptx │ └── toTIFF.pptx └── Spire.XLS ├── 01_quick guide ├── createAnExcelWithFiveSheets.java ├── createAnExcelWithOneSheet.java ├── createFiftyExcelFiles.java ├── helloWorld.java └── openExistingFile.java ├── 02_data ├── addScrollBarControl.java ├── addSpinnerControl.java ├── addTableWithFilter.java ├── addTotalRowToTable.java ├── applySubscriptAndSuperscript.java ├── cloneExcelFontStyle.java ├── copyCellsRange.java ├── copyDataWithStyle.java ├── createNestedGroup.java ├── createTable.java ├── dataExport.java ├── dataImport.java ├── dataSorting.java ├── expandAndCollapseGroups.java ├── findAndReplaceData.java ├── formatTable.java ├── importDataFromArrayList.java ├── importDataFromDataColumn.java ├── importDataFromDataTable.java ├── insertControls.java ├── insertHtmlStringIntoCell.java ├── replaceAndHighlight.java ├── retrieveAndExtractData.java ├── setArrayOfValuesIntoRange.java ├── splitDataIntoMultipleColumns.java └── writeRichText.java ├── 03_cells ├── accessCell.java ├── applyMultipleFontsInSingleCell.java ├── autoFitBasedOnCellValue.java ├── convertTextToNumber.java ├── copyCellFormat.java ├── countNumberOfCells.java ├── cutCellsToOtherPosition.java ├── detectMergedCells.java ├── duplicateCellRange.java ├── emptyCell.java ├── filterCellsByCellColor.java ├── findCellsWithStyleName.java ├── findFormulaCells.java ├── getCellAddress.java ├── getCellDataType.java ├── getCellDisplayedText.java ├── getCellValueByCellName.java ├── getIntersectionOfTwoRanges.java ├── hideCellContent.java ├── mergeCells.java ├── onlyCopyFormulaValue.java ├── setCellFillPattern.java ├── setDBNumFormatting.java ├── shrinkTextToFitInACell.java ├── traverseCellsValue.java ├── ungroupExcelCells.java ├── unmergeCells.java ├── useExplicitLineBreaks.java └── wrapOrUnwrapTextInCells.java ├── 04_rowsColumns ├── autoFitColumnInRange.java ├── autoFitRowInRange.java ├── copyColumns.java ├── copyRows.java ├── copySingleColumnAndRow.java ├── copyWithOptions.java ├── deleteBlankRowsAndColumns.java ├── deleteMultipleRowsAndColumns.java ├── getDefaultRowAndColumnCount.java ├── groupRowsAndColumns.java ├── hideOrShowRowColumnHeaders.java ├── hideRowsAndColumns.java ├── insertRowsAndColumns.java ├── removeRowBasedOnKeyword.java ├── setColumnWithInPixels.java ├── setDefaultRowAndColumnStyle.java ├── setDefaultRowHeight.java ├── setHeightAndWidth.java ├── setSummaryColumnDirection.java ├── setSummaryRowDirection.java └── unhideRowsAndColumns.java ├── 05_images ├── alignPictureWithinCell.java ├── copyPicture.java ├── croppedPositionOfPicture.java ├── deleteAllImages.java ├── insertExcelBackgroundImage.java ├── insertWebImage.java ├── locateImages.java ├── pictureOffset.java ├── pictureRefRange.java ├── readImages.java ├── resetSizeAndPositionForImage.java ├── setImageOffsetOfChart.java └── writeImages.java ├── 06_comments ├── addCommentWithAuthor.java ├── addCommentWithPicture.java ├── editExcelComment.java ├── hideOrShowComment.java ├── readComment.java ├── removeComment.java ├── setCommentTextRotation.java ├── setPositionAndAlignment.java └── writeComment.java ├── 07_conversion ├── ETTtoXls.java ├── ETtoXls.java ├── HtmlToExcel.java ├── XlsToET.java ├── XlsToETT.java ├── chartSheetToSVG.java ├── csvToDataTable.java ├── csvToExcel.java ├── csvToPDF.java ├── eachWorksheetToDifferentPDF.java ├── excelToHtml.java ├── fitWidthWhenConvertToPDF.java ├── officeOpenXMLToExcel.java ├── selectedRangeToPDF.java ├── sheetToImage.java ├── specificCellsToImage.java ├── specifyFontDirectory.java ├── toCSV.java ├── toHtml.java ├── toHtmlStream.java ├── toImageWithComments.java ├── toImageWithHighResolution.java ├── toImageWithoutWhiteSpace.java ├── toODS.java ├── toOfficeOpenXML.java ├── toPDF.java ├── toPDFSimply.java ├── toPdfWithChangePageSize.java ├── toPdfWithCustomPaperSize.java ├── toPostScript.java ├── toSVG.java ├── toText.java ├── toTiff.java ├── toXPS.java ├── xlsToXLSM.java └── xlsb.java ├── 08_filteringAndValidation ├── autofilterBlank.java ├── autofilterNonBlank.java ├── createFilter.java ├── dataValidation.java ├── filterCellsByString.java ├── getSettingsOfDataValidation.java ├── listDataValidation.java ├── removeAutoFilters.java ├── removeDataValidation.java ├── setDataValidationOnSeparateSheet.java ├── timeDataValidation.java ├── verifyDataByValidation.java └── wholeNumberDataValidation.java ├── 09_charts ├── addDataTable.java ├── addPictureInChart.java ├── addTextBox.java ├── addTrendline.java ├── adjustBarSpace.java ├── applySoftEdgesEffect.java ├── changeChartSizeAndPosition.java ├── changeDataLabel.java ├── changeDataRange.java ├── changeMajorGridlines.java ├── changeSeriesColor.java ├── chartAxisTitle.java ├── chartToImage.java ├── createDoughnutChart.java ├── createMultiLevelChart.java ├── createPivotChart.java ├── createRadarChart.java ├── customDataMarker.java ├── dataCallout.java ├── deleteLegend.java ├── discontinuousData.java ├── editLineChart.java ├── embedNonInstalledFonts.java ├── explodedDoughnut.java ├── extractTrendline.java ├── fillChartElementWithPicture.java ├── formatAxis.java ├── gaugeChart.java ├── getCategoryLabels.java ├── getChartDataPointValues.java ├── getWorksheetOfChart.java ├── hideMajorGridlines.java ├── line.java ├── pie.java ├── pyramidColumn.java ├── removeChart.java ├── richTextForDataLabel.java ├── rotate3DChart.java ├── setAndFormatDataLabel.java ├── setBorderColorAndStyle.java ├── setChartBackgroundColor.java ├── setFont.java ├── setFontForLegendAndDataTable.java ├── setFontForTitleAndAxis.java ├── setLegendBackgroundColor.java ├── setMarkerColorForSparkline.java ├── showLeaderLine.java └── sparkLine.java ├── 10_shapes ├── addArrowLineToExcelFile.java ├── addLineShape.java ├── addOvalShape.java ├── copyShapes.java ├── deleteAllShapes.java ├── deleteParticularShape.java ├── extractTextImageFromShape.java ├── hideOrUnhideShape.java ├── insertShapesToExcelSheet.java ├── modifyShadowStyleForShape.java ├── setShadowStyleForShape.java └── tillPicAsTextureInShape.java ├── 11_formatting ├── applyBuiltInStyles.java ├── applyColorScalesToDataRange.java ├── applyConditionalFormatting.java ├── applyDataBarsToCellRange.java ├── applyGradientFillEffects.java ├── applyIconSetsToCellRange.java ├── colorsAndPalette.java ├── conditionalFormatRuntime.java ├── conditionallyFormatDate.java ├── createFormulaConditionalFormat.java ├── fontStyles.java ├── foregroundAndBackground.java ├── formatAColumn.java ├── formatARow.java ├── formatCellsWithStyle.java ├── getStyleSetStyle.java ├── highlightAverageValues.java ├── highlightDuplicateUniqueValues.java ├── highlightRankedValues.java ├── indentation.java ├── interior.java ├── makeCellActive.java ├── numberStyles.java ├── setBorder.java ├── setConditionalFormatFormula.java ├── setRowColorByConditionalFormat.java ├── setTrafficLightsIcons.java ├── simpleConditionalFormatting.java ├── textAlign.java ├── textDirection.java ├── usePredefinedStyles.java ├── usingStyleObject.java └── variousConditionalFormatting.java ├── 12_formulas ├── calculateFormulas.java ├── insertFormulaWithNamedRange.java ├── readFormulas.java ├── registerAddInFunction.java ├── removeFormulasButKeepValues.java ├── useArrayFormulas.java ├── useArrayR1C1Formula.java ├── useR1C1Formula.java └── writeFormulas.java ├── 13_headerFooter ├── addWatermark.java ├── changeFontAndSize.java ├── differentHeaderFooter.java ├── differentHeaderFooterOnFirstPage.java ├── imageHeaderFooter.java └── setHeaderFooter.java ├── 14_hyperlink ├── addHyperlinkToText.java ├── addImageHyperlink.java ├── getHyperLinkType.java ├── linkToExternalFile.java ├── linkToOtherSheetCell.java ├── modifyHyperlink.java ├── readHyperlinks.java ├── removeHyperlinks.java ├── retrieveExternalFileHyperlinks.java └── writeHyperlinks.java ├── 15_markerDesigner ├── addCustomObject.java ├── addVariableArray.java ├── copyCellStyle.java ├── detectIsBlank.java ├── markerDesigner.java └── setDataDirection.java ├── 16_namedRanges ├── formatNamedRangeCells.java ├── getAllNamedRange.java ├── getNamedRangeAddress.java ├── getSpecificNamedRange.java ├── mergeNamedRangeCells.java ├── namedRanges.java ├── removeNamedRange.java ├── renameNamedRange.java ├── scopedNamedRange.java └── setFormulaWithNamedRange.java ├── 17_oleObjects ├── extractOLEObjects.java └── insertOLEObjects.java ├── 18_pageSetup ├── getExcelPaperDimensions.java ├── setExcelPageOrderType.java ├── setExcelPaperSize.java ├── setFirstPageNumber.java ├── setHeaderAndFooterMargins.java ├── setMarginsOfExcelSheet.java ├── setOtherPrintingOptions.java ├── setPageOrientation.java ├── setPrintAreaOfXlsFile.java ├── setPrintQualityOfXlsFile.java ├── setPrintTitleOfXlsFile.java ├── setSheetFitToPageProperty.java └── setXlsSheetCenterOnPage.java ├── 19_pivotTables ├── clearPivotFields.java ├── consolidationFunctions.java ├── createPivotTable.java ├── disablePivotTableRibbon.java ├── expandOrCollapseRows.java ├── formatDataField.java ├── formattingAppearance.java ├── getPivotTableRefreshedInfo.java ├── groupAndUngroup.java ├── hideAllItemOfPivotTable.java ├── refreshPivotTable.java ├── setFormatOptions.java ├── setPivotFieldFormat.java ├── setRepeatLabelsForPivotTable.java └── updateDataSource.java ├── 20_print ├── pageSetupForPrinting.java └── printExcel.java ├── 21_security ├── addAndRemoveDigitalSignature.java ├── detectProtection.java ├── hideFormulas.java ├── lockSpecificCellInNewExcel.java ├── lockSpecificColumnInNewExcel.java ├── lockSpecificRowInNewExcel.java ├── protectCell.java ├── protectWithEditableRange.java ├── protectWorkbook.java ├── unlockProtectSheet.java └── unlockSimpleSheet.java ├── 22_textBoxes ├── extractTextFromATextbox.java ├── getTextBoxByName.java ├── manipulateTextBox.java ├── removeBorderlineOfTextbox.java ├── replaceTextInTextBox.java ├── setFontAndBackground.java ├── setInternalMarginOfTextbox.java └── textBoxWithWrapText.java ├── 23_worksheets ├── activateWorksheet.java ├── addPageBreakInXlsFile.java ├── addWorksheet.java ├── applyStyleToWorksheet.java ├── copySheetToAnotherXlsFile.java ├── copySheetWithinWorkbook.java ├── copyVisibleSheets.java ├── copyWorksheet.java ├── detectEmptyWorksheet.java ├── fillDataInWorksheet.java ├── filteredValueToCSV.java ├── freezePanes.java ├── getGroupBoxes.java ├── getListOfFontsUsed.java ├── getPageCount.java ├── getPaperSize.java ├── getWorksheetNames.java ├── hideOrShowWorksheet.java ├── hideTab.java ├── hideZeroValues.java ├── linkToContentProperty.java ├── moveWorksheet.java ├── pageBreakPreview.java ├── removePageBreak.java ├── removeWorksheet.java ├── setPageBreak.java ├── setTabColor.java ├── setViewMode.java ├── showOrHideGridLine.java ├── showTab.java ├── splitWorksheetIntoPanes.java ├── unfreezeExcelPanes.java ├── verifyProtectedWorksheet.java └── zoomFactor.java └── 24_workbook ├── accessDocumentProperties.java ├── addCustomProperties.java ├── decryptWorkbook.java ├── detectExcelVersion.java ├── detectVBAMacros.java ├── encryptWorkbook.java ├── getProperties.java ├── loadAndSaveFileWithMacro.java ├── mergeExcelFiles.java ├── openEncryptedFile.java ├── openFiles.java ├── readStream.java ├── removeCustomProperties.java ├── saveFiles.java ├── saveStream.java ├── setExcelCalculationMode.java └── setMargins.java /Spire.Barcode/GUI/Barcode_GUI_Samples.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Barcode/GUI/Barcode_GUI_Samples.jar -------------------------------------------------------------------------------- /Spire.Barcode/scan/Scan.java: -------------------------------------------------------------------------------- 1 | package com.spire.demo; 2 | 3 | import com.spire.barcode.BarcodeScanner; 4 | 5 | public class Scan { 6 | public static void main(String[] args) throws Exception { 7 | 8 | //Scan 9 | //Get code information by scanning the image 10 | String[] s = BarcodeScanner.scan("CODABAR.png"); 11 | System.out.println(s[0]); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Doc/01_quickGuide/helloWorld.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import com.spire.doc.documents.Paragraph; 3 | 4 | public class helloWorld { 5 | public static void main(String[] args) { 6 | String output = "output/helloWorld.docx"; 7 | //create Word document 8 | Document document = new Document(); 9 | 10 | //create a new section 11 | Section section = document.addSection(); 12 | 13 | //create a new paragraph 14 | Paragraph paragraph = section.addParagraph(); 15 | 16 | //append text 17 | paragraph.appendText("Hello World!"); 18 | 19 | //save the file 20 | document.saveToFile(output, FileFormat.Docx); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.Doc/02_findAndReplace/findAndHighlight.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import com.spire.doc.documents.TextSelection; 3 | import java.awt.*; 4 | 5 | public class findAndHighlight { 6 | public static void main(String[] args) { 7 | String input = "data/findAndHighlight.docx"; 8 | String output = "output/findAndHighlight.docx"; 9 | //load Word document 10 | Document document = new Document(); 11 | document.loadFromFile(input); 12 | 13 | //find Text 14 | TextSelection[] textSelections = document.findAllString("Word", false, true); 15 | 16 | //set highlight 17 | for (TextSelection selection : textSelections) { 18 | selection.getAsOneRange().getCharacterFormat().setHighlightColor(Color.YELLOW); 19 | } 20 | 21 | //save the file 22 | document.saveToFile(output, FileFormat.Docx_2010); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spire.Doc/02_findAndReplace/replaceTextByRegex.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import java.util.regex.Pattern; 3 | 4 | public class replaceTextByRegex { 5 | public static void main(String[] args) { 6 | String input = "data/replaceTextByRegex.docx"; 7 | String output = "output/replaceTextByRegex.docx"; 8 | //load Word document 9 | Document document = new Document(); 10 | document.loadFromFile(input, FileFormat.Docx); 11 | 12 | //create a regex, match the text that starts with "#" 13 | String regEx="\\#\\w+\\b"; 14 | Pattern pattern= Pattern.compile(regEx); 15 | 16 | //replace the text by regex 17 | document.replace(pattern,"Spire.Doc"); 18 | 19 | //save the document 20 | document.saveToFile(output,FileFormat.Docx); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.Doc/02_findAndReplace/replaceWithText.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class replaceWithText { 4 | public static void main(String[] args) { 5 | String input = "data/replaceWithText.docx"; 6 | String output = "output/replaceWithText.docx"; 7 | //load Word document 8 | Document document = new Document(); 9 | document.loadFromFile(input, FileFormat.Docx); 10 | 11 | //replace the text 12 | document.replace("Word", "ReplacedText", false, true); 13 | 14 | //save the document 15 | document.saveToFile(output,FileFormat.Docx); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.Doc/04_content/bookmarks/removeBookmark.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class removeBookmark { 4 | public static void main(String[] args) { 5 | String input = "data/bookmark.docx"; 6 | String output = "output/removeBookmark.docx"; 7 | 8 | //load the document from disk. 9 | Document document = new Document(); 10 | document.loadFromFile(input); 11 | 12 | //get the bookmark by name. 13 | Bookmark bookmark = document.getBookmarks().get("Test"); 14 | 15 | //remove the bookmark, not its content. 16 | document.getBookmarks().remove(bookmark); 17 | 18 | //save the document. 19 | document.saveToFile(output, FileFormat.Docx); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.Doc/04_content/bookmarks/replaceBookmarkContent.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import com.spire.doc.documents.BookmarksNavigator; 3 | 4 | public class replaceBookmarkContent { 5 | public static void main(String[] args) { 6 | String input = "data/bookmark.docx"; 7 | String output = "output/replaceBookmarkContent.docx"; 8 | 9 | //load the document from disk. 10 | Document doc = new Document(); 11 | doc.loadFromFile(input); 12 | 13 | //locate the bookmark. 14 | BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(doc); 15 | bookmarkNavigator.moveToBookmark("Test"); 16 | 17 | //replace the context with new. 18 | bookmarkNavigator.replaceBookmarkContent("This is replaced content.",false); 19 | 20 | //save the document. 21 | doc.saveToFile(output, FileFormat.Docx); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.Doc/04_content/setImageBackground.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import com.spire.doc.documents.BackgroundType; 3 | import java.io.*; 4 | 5 | public class setImageBackground { 6 | public static void main(String[] args) throws IOException { 7 | 8 | String inputFile="data/setImageBackground.docx"; 9 | String backgroundImg="data/background.png"; 10 | String outputFile="output/setImageBackground.docx"; 11 | 12 | //load a word document 13 | Document document=new Document(inputFile); 14 | 15 | //set the background type as picture 16 | document.getBackground().setType(BackgroundType.Picture); 17 | 18 | //set the background picture 19 | document.getBackground().setPicture(backgroundImg); 20 | 21 | //save the file 22 | document.saveToFile(outputFile, FileFormat.Docx); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spire.Doc/04_content/table/autoFitToContents.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class autoFitToContents { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/tableSample.docx"; 7 | String outputFile="output/autoFitToContents.docx"; 8 | 9 | //create a document 10 | Document document = new Document(); 11 | //load file 12 | document.loadFromFile(inputFile); 13 | 14 | Section section = document.getSections().get(0); 15 | Table table = section.getTables().get(0); 16 | 17 | //automatically fit the table to the cell content 18 | table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Contents); 19 | 20 | //save to file 21 | document.saveToFile(outputFile,FileFormat.Docx); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.Doc/04_content/table/autoFitToFixed.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class autoFitToFixed { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/tableSample.docx"; 7 | String outputFile="output/autoFitToFixed.docx"; 8 | 9 | //create a document 10 | Document document = new Document(); 11 | //load file 12 | document.loadFromFile(inputFile); 13 | 14 | Section section = document.getSections().get(0); 15 | Table table = section.getTables().get(0); 16 | 17 | //the table is set to a fixed size 18 | table.autoFit(AutoFitBehaviorType.Fixed_Column_Widths); 19 | 20 | //save to file 21 | document.saveToFile(outputFile,FileFormat.Docx); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.Doc/04_content/table/autoFitToWindow.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class autoFitToWindow { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/tableSample.docx"; 7 | String outputFile="output/autoFitToWindow.docx"; 8 | 9 | //create a document 10 | Document document = new Document(); 11 | //load file 12 | document.loadFromFile(inputFile); 13 | 14 | Section section = document.getSections().get(0); 15 | Table table = section.getTables().get(0); 16 | 17 | //automatically fit the table to the active window width 18 | table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Window); 19 | 20 | //save to file 21 | document.saveToFile(outputFile,FileFormat.Docx); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/fromHtml/htmlFileToWord.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import com.spire.doc.documents.XHTMLValidationType; 3 | 4 | public class htmlFileToWord { 5 | public static void main(String[] args) { 6 | 7 | String inputFile="data/htmlFileToWord.html"; 8 | String outputFile="output/htmlFileToWord.docx"; 9 | 10 | //open an html file. 11 | Document document = new Document(); 12 | document.loadFromFile(inputFile, FileFormat.Html, XHTMLValidationType.None); 13 | 14 | //save to a Word document. 15 | document.saveToFile(outputFile, FileFormat.Docx); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toHtml/toHtml.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toHtml { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/toHtmlTemplate.docx"; 7 | String outputFile="output/toHtml.html"; 8 | 9 | //create word document 10 | Document document = new Document(); 11 | document.loadFromFile(inputFile); 12 | 13 | //save html file. 14 | document.saveToFile(outputFile, FileFormat.Html); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toImage.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.Document; 2 | import com.spire.doc.documents.ImageType; 3 | import javax.imageio.ImageIO; 4 | import java.awt.image.BufferedImage; 5 | import java.io.*; 6 | 7 | public class toImage { 8 | public static void main(String[] args) throws IOException { 9 | String input = "data/convertedTemplate.docx"; 10 | String output = "output/toImage.png"; 11 | 12 | //load Word document 13 | Document document= new Document(); 14 | document.loadFromFile(input); 15 | 16 | //save to images 17 | BufferedImage image= document.saveToImages(0, ImageType.Bitmap); 18 | File file= new File(output); 19 | ImageIO.write(image, "PNG", file); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toOdt.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toOdt { 4 | public static void main(String[] args) { 5 | String input = "data/convertedTemplate.docx"; 6 | String output = "output/toOdt.odt"; 7 | //load Word document 8 | Document document= new Document(); 9 | document.loadFromFile(input); 10 | 11 | //save the document to odt format 12 | document.saveToFile(output, FileFormat.Odt); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toPdf/embedAllFontsInPDF.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class embedAllFontsInPDF { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/convertedTemplate.docx"; 7 | String outputFile="output/embedAllFontsInPDF.pdf"; 8 | 9 | Document document = new Document(); 10 | document.loadFromFile(inputFile); 11 | 12 | //embeds full fonts by default when IsEmbeddedAllFonts is set to true. 13 | ToPdfParameterList ppl=new ToPdfParameterList(); 14 | ppl.isEmbeddedAllFonts(true); 15 | 16 | //save to pdf. 17 | document.saveToFile(outputFile, ppl); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toPdf/specifyEmbeddedFont.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | import java.util.*; 3 | 4 | public class specifyEmbeddedFont { 5 | public static void main(String[] args) { 6 | 7 | String inputFile="data/convertedTemplate.docx"; 8 | String outputFile="output/specifyEmbeddedFont.pdf"; 9 | 10 | Document document = new Document(); 11 | document.loadFromFile(inputFile); 12 | 13 | //specify embedded font 14 | ToPdfParameterList parms = new ToPdfParameterList(); 15 | List part = new ArrayList(); 16 | part.add("Lucida Sans Unicode"); 17 | parms.setEmbeddedFontNameList(part); 18 | 19 | document.saveToFile(outputFile, parms); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toPdf/toPDF.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toPDF { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/convertedTemplate.docx"; 7 | String outputFile="output/toPDF.pdf"; 8 | 9 | //create word document 10 | Document document = new Document(); 11 | document.loadFromFile(inputFile); 12 | 13 | //save the document to a PDF file. 14 | document.saveToFile(outputFile, FileFormat.PDF); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toRtf.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toRtf { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/convertedTemplate.docx"; 7 | String outputFile="output/toRtf.rtf"; 8 | 9 | //create word document 10 | Document document = new Document(); 11 | document.loadFromFile(inputFile); 12 | 13 | //save to file. 14 | document.saveToFile(outputFile, FileFormat.Rtf); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toSVG.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toSVG { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/convertedTemplate.docx"; 7 | String outputFile="output/toSVG.svg"; 8 | 9 | //create word document 10 | Document document = new Document(); 11 | document.loadFromFile(inputFile); 12 | document.saveToFile(outputFile, FileFormat.SVG); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toXML.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toXML { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/toXML.doc"; 7 | String outputFile="output/toXML.xml"; 8 | 9 | Document document = new Document(); 10 | document.loadFromFile(inputFile); 11 | document.saveToFile(outputFile, FileFormat.Xml ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Doc/05_conversion/toXPS.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class toXPS { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/convertedTemplate.docx"; 7 | String outputFile="output/toXPS.xps"; 8 | 9 | Document document=new Document(); 10 | document.loadFromFile(inputFile); 11 | document.saveToFile(outputFile, FileFormat.XPS ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Doc/06_protect/decrypt.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class decrypt { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/decrypt.docx"; 7 | String outputFile="output/decrypt.docx"; 8 | 9 | //create word document 10 | Document document = new Document(); 11 | document.loadFromFile(inputFile, FileFormat.Docx, "E-iceblue"); 12 | 13 | //save as doc file. 14 | document.saveToFile(outputFile, FileFormat.Docx); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Doc/06_protect/encrypt.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class encrypt { 4 | public static void main(String[] args) { 5 | 6 | String inputFile="data/encrypt.docx"; 7 | String outputFile="output/encrypt.docx"; 8 | 9 | //create word document 10 | Document document = new Document(); 11 | 12 | //load Word document. 13 | document.loadFromFile(inputFile); 14 | 15 | //encrypt document with password specified 16 | document.encrypt("E-iceblue"); 17 | 18 | //save as docx file. 19 | document.saveToFile(outputFile, FileFormat.Docx); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.Doc/08_misc/merge.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class merge { 4 | public static void main(String[] args) { 5 | String input1 = "data/merge1.doc"; 6 | String input2 = "data/merge2.docx"; 7 | String output = "output/merge.docx"; 8 | //create word document 9 | Document document = new Document(); 10 | document.loadFromFile(input1, FileFormat.Doc); 11 | 12 | Document documentMerge = new Document(); 13 | documentMerge.loadFromFile(input2, FileFormat.Docx); 14 | 15 | for (Section sec : (Iterable
) documentMerge.getSections()) { 16 | document.getSections().add(sec.deepClone()); 17 | } 18 | 19 | //save as docx file. 20 | document.saveToFile(output, FileFormat.Docx); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.Doc/11_macros/macros.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.*; 2 | 3 | public class macros { 4 | public static void main(String[] args) { 5 | String input = "data/macros.docm"; 6 | String output = "output/macros.docm"; 7 | 8 | //load Word document which contains macro 9 | Document doc = new Document(); 10 | doc.loadFromFile(input, FileFormat.Docm); 11 | 12 | //save the file 13 | doc.saveToFile(output,FileFormat.Docm); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spire.Doc/12_print/print.java: -------------------------------------------------------------------------------- 1 | import com.spire.doc.Document; 2 | 3 | public class print { 4 | public static void main(String[] args) { 5 | Document document = new Document(); 6 | document.loadFromFile("data/print.docx"); 7 | document.getPrintDocument().print(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Spire.Doc/data/Lucida Sans Unicode.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/Lucida Sans Unicode.ttf -------------------------------------------------------------------------------- /Spire.Doc/data/Summary_of_Science.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/Summary_of_Science.doc -------------------------------------------------------------------------------- /Spire.Doc/data/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/background.png -------------------------------------------------------------------------------- /Spire.Doc/data/bookmark.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/bookmark.docx -------------------------------------------------------------------------------- /Spire.Doc/data/comment.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/comment.docx -------------------------------------------------------------------------------- /Spire.Doc/data/convertedTemplate.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/convertedTemplate.docx -------------------------------------------------------------------------------- /Spire.Doc/data/decrypt.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/decrypt.docx -------------------------------------------------------------------------------- /Spire.Doc/data/encrypt.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/encrypt.docx -------------------------------------------------------------------------------- /Spire.Doc/data/example.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/example.xlsx -------------------------------------------------------------------------------- /Spire.Doc/data/excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/excel.png -------------------------------------------------------------------------------- /Spire.Doc/data/extractImage.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/extractImage.docx -------------------------------------------------------------------------------- /Spire.Doc/data/extractOLE.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/extractOLE.docx -------------------------------------------------------------------------------- /Spire.Doc/data/fillFormField.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/fillFormField.doc -------------------------------------------------------------------------------- /Spire.Doc/data/findAndHighlight.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/findAndHighlight.docx -------------------------------------------------------------------------------- /Spire.Doc/data/footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/footer.png -------------------------------------------------------------------------------- /Spire.Doc/data/getText.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/getText.docx -------------------------------------------------------------------------------- /Spire.Doc/data/handleAskField.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/handleAskField.docx -------------------------------------------------------------------------------- /Spire.Doc/data/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/header.png -------------------------------------------------------------------------------- /Spire.Doc/data/headerAndFooter.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/headerAndFooter.docx -------------------------------------------------------------------------------- /Spire.Doc/data/hideEmptyRegions.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/hideEmptyRegions.doc -------------------------------------------------------------------------------- /Spire.Doc/data/hyacinths.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/hyacinths.JPG -------------------------------------------------------------------------------- /Spire.Doc/data/imageWatermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/imageWatermark.png -------------------------------------------------------------------------------- /Spire.Doc/data/insertEndnote.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/insertEndnote.doc -------------------------------------------------------------------------------- /Spire.Doc/data/insertFootnote.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/insertFootnote.docx -------------------------------------------------------------------------------- /Spire.Doc/data/insertWordArt.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/insertWordArt.docx -------------------------------------------------------------------------------- /Spire.Doc/data/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/logo.png -------------------------------------------------------------------------------- /Spire.Doc/data/macros.docm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/macros.docm -------------------------------------------------------------------------------- /Spire.Doc/data/mailMerge.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/mailMerge.doc -------------------------------------------------------------------------------- /Spire.Doc/data/mailMergeImage.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/mailMergeImage.docx -------------------------------------------------------------------------------- /Spire.Doc/data/mailMergedImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/mailMergedImage.png -------------------------------------------------------------------------------- /Spire.Doc/data/merge1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/merge1.doc -------------------------------------------------------------------------------- /Spire.Doc/data/merge2.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/merge2.docx -------------------------------------------------------------------------------- /Spire.Doc/data/mergeEventHandler.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/mergeEventHandler.doc -------------------------------------------------------------------------------- /Spire.Doc/data/mergeEventHandler.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/mergeEventHandler.docx -------------------------------------------------------------------------------- /Spire.Doc/data/nestedMailMerge.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/nestedMailMerge.doc -------------------------------------------------------------------------------- /Spire.Doc/data/ornithogalum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/ornithogalum.jpg -------------------------------------------------------------------------------- /Spire.Doc/data/preserveWordBookmarks.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/preserveWordBookmarks.doc -------------------------------------------------------------------------------- /Spire.Doc/data/print.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/print.docx -------------------------------------------------------------------------------- /Spire.Doc/data/removeFootnote.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/removeFootnote.docx -------------------------------------------------------------------------------- /Spire.Doc/data/replaceTextByRegex.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/replaceTextByRegex.docx -------------------------------------------------------------------------------- /Spire.Doc/data/replaceWithHtml.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/replaceWithHtml.docx -------------------------------------------------------------------------------- /Spire.Doc/data/replaceWithText.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/replaceWithText.docx -------------------------------------------------------------------------------- /Spire.Doc/data/replyToComment.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/replyToComment.docx -------------------------------------------------------------------------------- /Spire.Doc/data/rosa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/rosa.jpg -------------------------------------------------------------------------------- /Spire.Doc/data/setImageBackground.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/setImageBackground.docx -------------------------------------------------------------------------------- /Spire.Doc/data/spireDoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/spireDoc.png -------------------------------------------------------------------------------- /Spire.Doc/data/tableSample.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/tableSample.docx -------------------------------------------------------------------------------- /Spire.Doc/data/toHtmlTemplate.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/toHtmlTemplate.docx -------------------------------------------------------------------------------- /Spire.Doc/data/toOdt.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/toOdt.docx -------------------------------------------------------------------------------- /Spire.Doc/data/toXML.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/toXML.doc -------------------------------------------------------------------------------- /Spire.Doc/data/user.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | harry.hu@e-iceblue.com 4 | harry.hu 5 | e-iceblue 6 | Mr. 7 | Harry 8 | Hu 9 | Dalu.Ziyunjinsha, Beisen Road North 96, Chengdu, China 10 | Chengdu 11 | 610000 12 | China 13 | Sichuan 14 | 028-81705109 15 | 028-81705109 16 | true 17 | -------------------------------------------------------------------------------- /Spire.Doc/data/watermarkTemplate.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Doc/data/watermarkTemplate.doc -------------------------------------------------------------------------------- /Spire.Pdf/01_quickGuide/helloWorld.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | import com.spire.pdf.graphics.*; 3 | import java.awt.*; 4 | 5 | public class helloWorld { 6 | public static void main(String[] args) { 7 | // Create a pdf document 8 | PdfDocument doc = new PdfDocument(); 9 | // Compress level 10 | doc.setCompressionLevel(PdfCompressionLevel.None); 11 | // Add a pdf page 12 | PdfPageBase page = doc.getPages().add(); 13 | // Create PdfRGBColor 14 | PdfRGBColor color = new PdfRGBColor(Color.black); 15 | //Draw the text 16 | page.getCanvas().drawString("Hello World!", 17 | new PdfFont(PdfFontFamily.Helvetica, 30), 18 | new PdfSolidBrush(color), 35, 35); 19 | // Save to File 20 | doc.saveToFile("output/helloWorld.pdf"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.Pdf/04_page/deleteImage.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class deleteImage { 4 | public static void main(String[] args) { 5 | PdfDocument doc = new PdfDocument(); 6 | doc.loadFromFile("data/deleteImage.pdf"); 7 | PdfPageBase page = doc.getPages().get(0); 8 | page.deleteImage(0); 9 | doc.saveToFile("output/deleteImage.pdf"); 10 | doc.close(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Spire.Pdf/04_page/deletePage.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class deletePage { 4 | public static void main(String[] args) { 5 | PdfDocument doc = new PdfDocument("data/deletePage.pdf"); 6 | //Delete the third page 7 | doc.getPages().removeAt(2); 8 | //Save the document 9 | doc.saveToFile("output/deletePage.pdf"); 10 | doc.close(); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Spire.Pdf/04_page/findAndHighlightText.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | import java.awt.*; 3 | import com.spire.pdf.general.find.PdfTextFind; 4 | 5 | public class findAndHighlightText { 6 | public static void main(String[] args) throws Exception { 7 | PdfDocument pdf = new PdfDocument(); 8 | pdf.loadFromFile("data/findAndHighlightText.pdf"); 9 | PdfTextFind[] result = null; 10 | for (PdfPageBase page : (Iterable) pdf.getPages()) { 11 | result = page.findText("science").getFinds(); 12 | for (PdfTextFind find : result) { 13 | find.applyHighLight(Color.yellow); 14 | } 15 | } 16 | pdf.saveToFile("output/findAndHighlightText.pdf"); 17 | pdf.close(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.Pdf/04_page/getNumberOfPages.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | import java.io.FileWriter; 3 | 4 | public class getNumberOfPages { 5 | public static void main(String[] args) throws Exception { 6 | PdfDocument pdf = new PdfDocument("data/getNumberOfPages.pdf"); 7 | int count = pdf.getPages().getCount(); 8 | String outputFile = "output/GetNumberOfPages.txt"; 9 | FileWriter writer = new FileWriter(outputFile); 10 | writer.write("PagesCount:" + String.valueOf(count)); 11 | writer.flush(); 12 | writer.close(); 13 | pdf.close(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spire.Pdf/04_page/layers/deleteLayer.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class deleteLayer { 4 | public static void main(String[] args) throws Exception{ 5 | PdfDocument doc = new PdfDocument(); 6 | doc.loadFromFile("data/deleteLayer.pdf"); 7 | PdfPageBase page = doc.getPages().get(0); 8 | //Remove a layer 9 | doc.getLayers().removeLayer("red line1"); 10 | doc.saveToFile("output/deleteLayer.pdf"); 11 | doc.close(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Pdf/07_waterMark/imageWaterMark.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | 4 | public class imageWaterMark { 5 | public static void main(String[] args) { 6 | //Create a pdf document. 7 | PdfDocument doc = new PdfDocument(); 8 | doc.loadFromFile("data/waterMark.pdf"); 9 | PdfPageBase page = doc.getPages().get(0); 10 | page.setBackgroundImage("data/Background.png"); 11 | //Save pdf file. 12 | doc.saveToFile("output/imageWaterMark.pdf"); 13 | doc.close(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spire.Pdf/09_interaction/annotation/deleteAnnotation.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | 3 | public class deleteAnnotation { 4 | public static void main(String[] args) { 5 | PdfDocument doc = new PdfDocument(); 6 | doc.loadFromFile("data/deleteAnnotation.pdf"); 7 | doc.getPages().get(0).getAnnotationsWidget().removeAt(0); 8 | doc.saveToFile("output/deleteAnnotation.pdf"); 9 | doc.close(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Spire.Pdf/09_interaction/attachment/deleteAllAttachments.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | import com.spire.pdf.attachments.*; 3 | 4 | public class deleteAllAttachments { 5 | public static void main(String[] args) { 6 | PdfDocument doc = new PdfDocument(); 7 | doc.loadFromFile("data/deleteAllAttachments.pdf"); 8 | 9 | PdfAttachmentCollection attachments = doc.getAttachments(); 10 | //Delete all attachments 11 | attachments.clear(); 12 | 13 | doc.saveToFile("output/deleteAllAttachments.pdf"); 14 | doc.close(); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.Pdf/09_interaction/bookmark/deleteBookmark.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | 3 | public class deleteBookmark { 4 | public static void main(String[] args) { 5 | PdfDocument doc = new PdfDocument(); 6 | doc.loadFromFile("data/deleteBookmark.pdf"); 7 | 8 | doc.getBookmarks().removeAt(0); 9 | 10 | doc.saveToFile("output/deleteBookmark.pdf"); 11 | doc.close(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Pdf/09_interaction/formField/flattenFormField.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | 3 | public class flattenFormField { 4 | public static void main(String[] args) { 5 | String inputFile = "data/flattenFormField.pdf"; 6 | String outputFile = "output/flattenFormField.pdf"; 7 | 8 | PdfDocument doc = new PdfDocument(); 9 | doc.loadFromFile(inputFile); 10 | //Flatten form fields 11 | doc.getForm().isFlatten(true); 12 | 13 | doc.saveToFile(outputFile); 14 | doc.close(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Pdf/10_securityAndSignatures/decryption.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | import com.spire.pdf.security.*; 3 | 4 | public class decryption { 5 | public static void main(String[] args) throws java.lang.Exception { 6 | String inputFile = "data/decryption.pdf"; 7 | String outputFile = "output/decryption_result.pdf"; 8 | 9 | //Load a pdf document. 10 | PdfDocument doc = new PdfDocument(); 11 | doc.loadFromFile(inputFile, "test"); 12 | 13 | //Decrypt the document 14 | doc.getSecurity().encrypt("", "", PdfPermissionsFlags.getDefaultPermissions(), PdfEncryptionKeySize.Key_256_Bit, "test"); 15 | doc.saveToFile(outputFile); 16 | doc.close(); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.Pdf/11_conversion/toHTML.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class toHTML { 4 | public static void main(String[] args) { 5 | String inputFile = "data/toHTML.pdf"; 6 | String outputFile = "output/toHTML_result.html"; 7 | 8 | //Open pdf document 9 | PdfDocument pdf = new PdfDocument(); 10 | pdf.loadFromFile(inputFile); 11 | pdf.saveToFile(outputFile,FileFormat.HTML); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Pdf/11_conversion/toImage.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | import javax.imageio.ImageIO; 3 | import java.io.*; 4 | import java.awt.image.BufferedImage; 5 | 6 | public class toImage { 7 | public static void main(String[] args) throws IOException { 8 | String inputFile = "data/toImage.pdf"; 9 | String outputPath = "output/"; 10 | 11 | //Open pdf document 12 | PdfDocument doc = new PdfDocument(); 13 | doc.loadFromFile(inputFile); 14 | 15 | //Save to images 16 | BufferedImage image; 17 | for (int i = 0; i < doc.getPages().getCount(); i++) { 18 | image = doc.saveAsImage(i); 19 | File file = new File(outputPath + "/" + String.format(("ToImage-img-%d.png"), i)); 20 | ImageIO.write(image, "PNG", file); 21 | } 22 | 23 | doc.close(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Spire.Pdf/11_conversion/toSVG.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class toSVG { 4 | public static void main(String[] args) { 5 | String inputFile = "data/toSVG.pdf"; 6 | String outputFile = "output/toSVG_result.svg"; 7 | 8 | //Open pdf document 9 | PdfDocument doc = new PdfDocument(); 10 | doc.loadFromFile(inputFile); 11 | 12 | //Convert to svg file 13 | doc.saveToFile(outputFile, FileFormat.SVG); 14 | doc.close(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Pdf/11_conversion/toWord.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class toWord { 4 | public static void main(String[] args) { 5 | String inputFile = "data/toWord.pdf"; 6 | String outputFile = "output/toWord_result.docx"; 7 | 8 | //Open pdf document 9 | PdfDocument pdf = new PdfDocument(); 10 | pdf.loadFromFile(inputFile); 11 | pdf.saveToFile(outputFile,FileFormat.DOCX); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Pdf/11_conversion/toXPS.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class toXPS { 4 | public static void main(String[] args) { 5 | String inputFile = "data/toXPS.pdf"; 6 | String outputFile = "output/toXPS_result.xps"; 7 | 8 | //Open pdf document 9 | PdfDocument pdf = new PdfDocument(); 10 | pdf.loadFromFile(inputFile); 11 | 12 | //Convert to xps file. 13 | pdf.saveToFile(outputFile, FileFormat.XPS); 14 | pdf.close(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Pdf/11_conversion/xpsToPDF.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | 3 | public class xPSToPDF { 4 | public static void main(String[] args) { 5 | String inputFile = "data/XPStoPDF.xps"; 6 | String outputFile = "output/XPStoPDF_result.pdf"; 7 | 8 | //Open xps document 9 | PdfDocument doc = new PdfDocument(); 10 | doc.loadFromXPS(inputFile); 11 | 12 | //Convert to pdf file 13 | doc.saveToFile(outputFile); 14 | doc.close(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Pdf/13_documentOperation/booklet.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class booklet { 4 | public static void main(String[] args) { 5 | String srcPdf = "data/booklet.pdf"; 6 | String outputFile = "output/booklet_result.pdf"; 7 | 8 | //Create a pdf document 9 | PdfDocument doc = new PdfDocument(); 10 | 11 | //Create booklet 12 | float width = (float) PdfPageSize.A4.getWidth() * 2; 13 | float height = (float) PdfPageSize.A4.getHeight(); 14 | doc.createBooklet(srcPdf, width, height, true); 15 | 16 | //Save the file 17 | doc.saveToFile(outputFile); 18 | doc.close(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spire.Pdf/13_documentOperation/changePdfVersion.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | 3 | public class changePdfVersion { 4 | public static void main(String[] args) { 5 | String inputFile = "data/changePdfVersion.pdf"; 6 | String outputFile = "output/pdfChangePdfVersion_result.pdf"; 7 | 8 | //Open pdf document 9 | PdfDocument document = new PdfDocument(); 10 | document.loadFromFile(inputFile); 11 | 12 | //Change the pdf version and save 13 | document.getFileInfo().setVersion(PdfVersion.Version_1_6); 14 | document.saveToFile(outputFile, FileFormat.PDF); 15 | document.close(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.Pdf/13_documentOperation/mergePdfsByStream.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | import java.io.*; 3 | 4 | public class mergePdfsByStream { 5 | public static void main(String[] args) throws Exception { 6 | String outputFile = "output/mergeFilesByStream_result.pdf"; 7 | 8 | FileInputStream stream1 = new FileInputStream(new File("data/mergePdfsTemplate_1.pdf")); 9 | FileInputStream stream2 = new FileInputStream(new File("data/mergePdfsTemplate_2.pdf")); 10 | FileInputStream stream3 = new FileInputStream(new File("data/mergePdfsTemplate_3.pdf")); 11 | 12 | InputStream[] streams = new FileInputStream[]{stream1, stream2, stream3}; 13 | 14 | //Merge files by stream 15 | PdfDocumentBase doc = PdfDocument.mergeFiles(streams); 16 | 17 | //Save the file 18 | doc.save(outputFile); 19 | doc.close(); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.Pdf/13_documentOperation/splitDocument.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.PdfDocument; 2 | 3 | public class splitDocument { 4 | public static void main(String[] args) { 5 | String inputFile = "data/splitDocument.pdf"; 6 | String outputFile = "output/splitDocument-{0}.pdf"; 7 | 8 | int count = 0; 9 | //Open pdf document 10 | PdfDocument doc = new PdfDocument(); 11 | doc.loadFromFile(inputFile); 12 | count = doc.getPages().getCount(); 13 | 14 | //Split document 15 | doc.split(outputFile, 0); 16 | doc.close(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.Pdf/14_print/printWithCustomizedPageSize.java: -------------------------------------------------------------------------------- 1 | import com.spire.pdf.*; 2 | import java.awt.print.*; 3 | 4 | public class printWithCustomizedPageSize { 5 | public static void main(String[] args) { 6 | String inputFile = "data/print.pdf"; 7 | PdfDocument loDoc = new PdfDocument(inputFile); 8 | PrinterJob loPrinterJob = PrinterJob.getPrinterJob(); 9 | PageFormat loPageFormat = loPrinterJob.defaultPage(); 10 | Paper loPaper = loPageFormat.getPaper(); 11 | loPaper.setSize(500,600); 12 | loPageFormat.setPaper(loPaper); 13 | loPrinterJob.setPrintable(loDoc,loPageFormat); 14 | 15 | try { 16 | loPrinterJob.print(); 17 | } catch (PrinterException e) { 18 | e.printStackTrace(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.Pdf/data/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/Background.png -------------------------------------------------------------------------------- /Spire.Pdf/data/E-iceblueLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/E-iceblueLogo.png -------------------------------------------------------------------------------- /Spire.Pdf/data/Hawaii_Killer.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/Hawaii_Killer.ttf -------------------------------------------------------------------------------- /Spire.Pdf/data/SalesReportChart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/SalesReportChart.png -------------------------------------------------------------------------------- /Spire.Pdf/data/SciencePersonificationBoston.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/SciencePersonificationBoston.jpg -------------------------------------------------------------------------------- /Spire.Pdf/data/Science_History_and_Etymology.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/Science_History_and_Etymology.txt -------------------------------------------------------------------------------- /Spire.Pdf/data/Wikipedia_Science.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/Wikipedia_Science.png -------------------------------------------------------------------------------- /Spire.Pdf/data/XPStoPDF.xps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/XPStoPDF.xps -------------------------------------------------------------------------------- /Spire.Pdf/data/addLayer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/addLayer.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/addTableOfContent.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/addTableOfContent.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/addTooltipForFormField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/addTooltipForFormField.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/booklet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/booklet.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/changePdfVersion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/changePdfVersion.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/changeSecurityPermission.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/changeSecurityPermission.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/chartImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/chartImage.png -------------------------------------------------------------------------------- /Spire.Pdf/data/compressDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/compressDocument.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/decryption.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/decryption.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deleteAllAttachments.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deleteAllAttachments.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deleteAnnotation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deleteAnnotation.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deleteBookmark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deleteBookmark.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deleteFormField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deleteFormField.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deleteImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deleteImage.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deleteLayer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deleteLayer.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/deletePage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/deletePage.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/demo.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/demo.mdb -------------------------------------------------------------------------------- /Spire.Pdf/data/determineRequiredField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/determineRequiredField.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/digitalSignature.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/digitalSignature.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/encryption.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/encryption.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/extractJavaScript.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/extractJavaScript.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/extraction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/extraction.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/fillFormField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/fillFormField.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/findAndHighlightText.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/findAndHighlightText.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/flattenFormField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/flattenFormField.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/footer.png -------------------------------------------------------------------------------- /Spire.Pdf/data/gary.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/gary.pfx -------------------------------------------------------------------------------- /Spire.Pdf/data/getNumberOfPages.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/getNumberOfPages.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/goToAction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/goToAction.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/header.png -------------------------------------------------------------------------------- /Spire.Pdf/data/headerAndFooter.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/headerAndFooter.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/image stamp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/image stamp.jpg -------------------------------------------------------------------------------- /Spire.Pdf/data/isModifiedSignedPDF.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/isModifiedSignedPDF.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/mergePdfsTemplate_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/mergePdfsTemplate_1.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/mergePdfsTemplate_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/mergePdfsTemplate_2.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/mergePdfsTemplate_3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/mergePdfsTemplate_3.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/overlay1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/overlay1.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/overlay2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/overlay2.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/pdfIcon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/pdfIcon.jpg -------------------------------------------------------------------------------- /Spire.Pdf/data/print.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/print.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/properties.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/properties.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/resetPageSize.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/resetPageSize.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/setXMPMetadata.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/setXMPMetadata.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/setZoomFactor.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/setZoomFactor.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/splitDocument.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/splitDocument.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/stamp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/stamp.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/toHTML.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/toHTML.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/toImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/toImage.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/toPDFA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/toPDFA.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/toSVG.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/toSVG.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/toWord.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/toWord.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/toXPS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/toXPS.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/updateBookmark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/updateBookmark.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/viewerPreference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/viewerPreference.pdf -------------------------------------------------------------------------------- /Spire.Pdf/data/waterMark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Pdf/data/waterMark.pdf -------------------------------------------------------------------------------- /Spire.Presentation/03_imagesAndShapes/extractImage.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.Presentation; 2 | import javax.imageio.ImageIO; 3 | import java.awt.image.BufferedImage; 4 | import java.io.File; 5 | 6 | public class extractImage { 7 | public static void main(String[] args) throws Exception { 8 | String inputFile = "data/extractImage.pptx"; 9 | String outputPath = "output/"; 10 | 11 | //Load a PPT document 12 | Presentation ppt = new Presentation(); 13 | ppt.loadFromFile(inputFile); 14 | 15 | for (int i = 0; i < ppt.getImages().getCount(); i++) { 16 | String ImageName = outputPath + String.format("extractImage-%1$s.png", i); 17 | //Extract image 18 | BufferedImage image = ppt.getImages().get(i).getImage(); 19 | ImageIO.write(image, "PNG", new File(ImageName)); 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Spire.Presentation/04_tableAndChart/saveChartAsImage.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.Presentation; 2 | import javax.imageio.ImageIO; 3 | import java.awt.image.BufferedImage; 4 | import java.io.File; 5 | 6 | public class saveChartAsImage { 7 | public static void main(String[] args) throws Exception { 8 | String inputFile = "data/saveChartAsImage.pptx"; 9 | String outputFile = "output/saveChartAsImage_result.png"; 10 | 11 | //Create a ppt document and load file 12 | Presentation presentation = new Presentation(); 13 | presentation.loadFromFile(inputFile); 14 | 15 | //Save chart as image in .png format 16 | BufferedImage image = presentation.getSlides().get(0).getShapes().saveAsImage(0); 17 | ImageIO.write(image,"PNG",new File(outputFile)); 18 | } 19 | } -------------------------------------------------------------------------------- /Spire.Presentation/06_protect/encrypt.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | public class encrypt { 3 | public static void main(String[] args)throws Exception{ 4 | String inputFile ="data/encrypt.pptx"; 5 | String outputFile="output/encrypt_result.pptx"; 6 | Presentation presentation = new Presentation(); 7 | presentation.loadFromFile(inputFile); 8 | String strPassword = "e-iceblue"; 9 | presentation.encrypt(strPassword); 10 | presentation.saveToFile(outputFile, FileFormat.PPTX_2010); 11 | presentation.dispose(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Presentation/06_protect/openEncryptedPPT.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class openEncryptedPPT { 4 | public static void main(String[] args) throws Exception{ 5 | String inputFile ="data/openEncryptedPPT.pptx"; 6 | String outputFile="output/openEncryptedPPT_result.pptx"; 7 | 8 | Presentation presentation = new Presentation(); 9 | presentation.loadFromFile(inputFile, "123456"); 10 | //Save as a new PPT with original password 11 | presentation.saveToFile(outputFile, FileFormat.PPTX_2010); 12 | presentation.dispose(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Presentation/06_protect/removeEncyption.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class removeEncyption { 4 | public static void main(String[] args) throws Exception { 5 | String inputFile ="data/removeEncyption.pptx"; 6 | String outputFile="output/removeEncyption_result.pptx"; 7 | 8 | Presentation presentation = new Presentation(); 9 | presentation.loadFromFile(inputFile, FileFormat.PPTX_2010, "123456"); 10 | presentation.removeEncryption(); 11 | presentation.saveToFile(outputFile, FileFormat.PPTX_2010); 12 | presentation.dispose(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Presentation/06_protect/setDocumentReadOnly.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class setDocumentReadOnly { 4 | public static void main(String[] args) throws Exception { 5 | String inputFile ="data/setDocumentReadOnly.pptx"; 6 | String outputFile="output/setDocumentReadOnly_result.pptx"; 7 | 8 | Presentation presentation = new Presentation(); 9 | presentation.loadFromFile(inputFile); 10 | String password = "123456"; 11 | presentation.protect(password); 12 | presentation.saveToFile(outputFile, FileFormat.PPTX_2010); 13 | presentation.dispose(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Spire.Presentation/08_properties/markAsFinal.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.FileFormat; 2 | import com.spire.presentation.Presentation; 3 | 4 | public class markAsFinal { 5 | public static void main(String[] args) throws Exception { 6 | String inputFile = "data/markAsFinal.pptx"; 7 | String outputFile = "output/markAsFinal_result.pptx"; 8 | Presentation presentation = new Presentation(); 9 | presentation.loadFromFile(inputFile); 10 | presentation.getDocumentProperty().set("_MarkAsFinal", true); 11 | presentation.saveToFile(outputFile, FileFormat.PPTX_2010); 12 | presentation.dispose(); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Spire.Presentation/09_slides/changeSlideLayout.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class changeSlideLayout { 4 | public static void main(String[] args) throws Exception{ 5 | String inputFile = "data/changeSlideLayout.pptx"; 6 | String outputFile = "output/changeSlideLayout_result.pptx"; 7 | Presentation ppt = new Presentation(); 8 | ppt.loadFromFile(inputFile); 9 | //Change the layout of slide 10 | ppt.getSlides().get(1).setLayout(ppt.getMasters().get(0).getLayouts().get(4)); 11 | ppt.saveToFile(outputFile, FileFormat.PPTX_2010); 12 | ppt.dispose(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Presentation/09_slides/changeSlidePosition.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*;; 2 | 3 | public class changeSlidePosition { 4 | public static void main(String[] args) throws Exception{ 5 | String inputFile = "data/changeSlidePosition.pptx"; 6 | String outputFile = "output/changeSlidePosition_result.pptx"; 7 | Presentation ppt = new Presentation(); 8 | ppt.loadFromFile(inputFile); 9 | //Move the first slide to the second slide position 10 | ISlide slide = ppt.getSlides().get(0); 11 | slide.setSlideNumber(2); 12 | ppt.saveToFile(outputFile, FileFormat.PPTX_2010); 13 | ppt.dispose(); 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Spire.Presentation/09_slides/hideSlide.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class hideSlide { 4 | public static void main(String[] args) throws Exception{ 5 | String inputFile = "data/hideSlide.pptx"; 6 | String outputFile = "output/hideSlide_result.pptx"; 7 | //Create a PPT document and load PPT file from disk 8 | Presentation ppt = new Presentation(); 9 | ppt.loadFromFile(inputFile); 10 | //Hide the second slide 11 | ppt.getSlides().get(1).setHidden(true); 12 | //Save the document 13 | ppt.saveToFile(outputFile, FileFormat.PPTX_2010); 14 | ppt.dispose(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.Presentation/09_slides/removeSlide.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class removeSlide { 4 | public static void main(String[] args) throws Exception{ 5 | String inputFile ="data/removeSlide.pptx"; 6 | String outputFile="output/removeSlide_result.pptx"; 7 | Presentation presentation = new Presentation(); 8 | presentation.loadFromFile(inputFile); 9 | //Remove the second slide 10 | presentation.getSlides().removeAt(1); 11 | presentation.saveToFile(outputFile, FileFormat.PPTX_2010); 12 | presentation.dispose(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Presentation/10_conversion/toImage.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.Presentation; 2 | import javax.imageio.ImageIO; 3 | import java.awt.image.BufferedImage; 4 | import java.io.File; 5 | 6 | public class toImage { 7 | public static void main(String[] args) throws Exception{ 8 | String inputFile ="data/toImage.pptx"; 9 | String outputFile="output"; 10 | Presentation ppt = new Presentation(); 11 | ppt.loadFromFile(inputFile); 12 | //Save PPT document to images 13 | for (int i = 0; i < ppt.getSlides().getCount(); i++) { 14 | BufferedImage image = ppt.getSlides().get(i).saveAsImage(); 15 | String fileName = outputFile + "/" + String.format("ToImage-%1$s.png", i); 16 | ImageIO.write(image, "PNG",new File(fileName)); 17 | } 18 | ppt.dispose(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spire.Presentation/10_conversion/toPDF.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class toPDF { 4 | public static void main(String[] args) throws Exception { 5 | String inputFile ="data/toPDF.pptx"; 6 | String outputFile="output/toPDF_result.pdf"; 7 | Presentation ppt = new Presentation(); 8 | ppt.loadFromFile(inputFile); 9 | //Save the PPT to PDF file format 10 | ppt.saveToFile(outputFile, FileFormat.PDF); 11 | ppt.dispose(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Spire.Presentation/10_conversion/toPPTX.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class toPPTX { 4 | public static void main(String[] args) throws Exception { 5 | String inputFile ="data/toPPTX.ppt"; 6 | String outputFile="output/toPPTX_result.pptx"; 7 | Presentation pt = new Presentation(); 8 | //Load the PPT file from disk 9 | pt.loadFromFile(inputFile); 10 | //Save the PPT document to PPTX file format 11 | pt.saveToFile(outputFile, FileFormat.PPTX_2013); 12 | pt.dispose(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Spire.Presentation/10_conversion/toSVG.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.Presentation; 2 | import java.io.FileOutputStream; 3 | import java.util.ArrayList; 4 | 5 | public class toSVG { 6 | public static void main(String[] args) throws Exception{ 7 | String inputFile ="data/toSVG.pptx"; 8 | String outputFile="output/"; 9 | Presentation ppt = new Presentation(); 10 | ppt.loadFromFile(inputFile); 11 | ArrayList svgBytes =(ArrayList) ppt.saveToSVG(); 12 | int count = svgBytes.size(); 13 | int len = svgBytes.size(); 14 | for (int i = 0; i < len; i++) 15 | { 16 | byte[] bytes = svgBytes.get(i); 17 | FileOutputStream stream = new FileOutputStream(String.format(outputFile + "ToSVG-%d.svg", i)); 18 | stream.write(bytes); 19 | } 20 | ppt.dispose(); 21 | } 22 | } -------------------------------------------------------------------------------- /Spire.Presentation/11_smartArt/removeNode.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | import com.spire.presentation.diagrams.*; 3 | 4 | public class removeNode { 5 | public static void main(String[] args) throws Exception{ 6 | String inputFile = "data/removeNode.pptx"; 7 | String outputFile = "output/removeNode_result.pptx"; 8 | Presentation ppt = new Presentation(); 9 | ppt.loadFromFile(inputFile); 10 | //Get the SmartArt and collect nodes 11 | ISmartArt sa = (ISmartArt) ((ppt.getSlides().get(0).getShapes().get(0) instanceof ISmartArt) ? ppt.getSlides().get(0).getShapes().get(0) : null); 12 | ISmartArtNodeCollection nodes = sa.getNodes(); 13 | //Remove the node to specific position 14 | nodes.removeNodeByPosition(2); 15 | ppt.saveToFile(outputFile, FileFormat.PPTX_2013); 16 | ppt.dispose(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.Presentation/12_commentAndNote/addComment.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | import java.awt.geom.Point2D; 3 | 4 | public class addComment { 5 | public static void main(String[] args) throws Exception { 6 | String inputFile = "data/addComment.pptx"; 7 | String outputFile = "output/addComment_result.pptx"; 8 | Presentation ppt = new Presentation(); 9 | ppt.loadFromFile(inputFile); 10 | //Comment author 11 | ICommentAuthor author = ppt.getCommentAuthors().addAuthor("E-iceblue", "comment:"); 12 | //Add comment 13 | ppt.getSlides().get(0).addComment(author, "Add comment", new Point2D.Float(44, 19), new java.util.Date()); 14 | //Save the document 15 | ppt.saveToFile(outputFile, FileFormat.PPTX_2010); 16 | ppt.dispose(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.Presentation/12_commentAndNote/deleteComment.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.*; 2 | 3 | public class deleteComment { 4 | public static void main(String[] args) throws Exception{ 5 | String inputFile ="data/deleteComment.pptx"; 6 | String outputFile="output/deleteComment_result.pptx"; 7 | Presentation ppt = new Presentation(); 8 | ppt.loadFromFile(inputFile); 9 | //Replace the text in the comment 10 | ppt.getSlides().get(0).getComments()[1].setText("Replace comment"); 11 | 12 | //Delete the third comment 13 | ppt.getSlides().get(0).deleteComment(ppt.getSlides().get(0).getComments()[1]); 14 | 15 | //Save the document 16 | ppt.saveToFile(outputFile, FileFormat.PPTX_2010); 17 | ppt.dispose(); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Spire.Presentation/13_Print/print.java: -------------------------------------------------------------------------------- 1 | import com.spire.presentation.Presentation; 2 | import com.spire.presentation.PresentationPrintDocument; 3 | 4 | public class print { 5 | public static void main(String[] args) throws Exception{ 6 | 7 | String inputFile ="data/print.pptx"; 8 | Presentation ppt = new Presentation(); 9 | ppt.loadFromFile(inputFile); 10 | PresentationPrintDocument document = new PresentationPrintDocument(ppt); 11 | document.print(); 12 | ppt.dispose(); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Spire.Presentation/data/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/Logo.png -------------------------------------------------------------------------------- /Spire.Presentation/data/Music.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/Music.wav -------------------------------------------------------------------------------- /Spire.Presentation/data/Video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/Video.mp4 -------------------------------------------------------------------------------- /Spire.Presentation/data/Video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/Video.png -------------------------------------------------------------------------------- /Spire.Presentation/data/addComment.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/addComment.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/addImageInMaster.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/addImageInMaster.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/addImageInTableCell.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/addImageInTableCell.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/addNote.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/addNote.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/addSmartArtNode.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/addSmartArtNode.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/addWatermark.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/addWatermark.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/alignment.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/alignment.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/animations.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/animations.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/appendHTML.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/appendHTML.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/appendSlideWithMasterLayout.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/appendSlideWithMasterLayout.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/backgroundImg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/backgroundImg.png -------------------------------------------------------------------------------- /Spire.Presentation/data/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/bg.png -------------------------------------------------------------------------------- /Spire.Presentation/data/bordersAndShading.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/bordersAndShading.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/bulltes.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/bulltes.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/changeSlideLayout.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/changeSlideLayout.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/changeSlidePosition.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/changeSlidePosition.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/changeTextFontInChart.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/changeTextFontInChart.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/changeTextStyle.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/changeTextStyle.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/chartAxis.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/chartAxis.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/cloneSlideToAnotherPPT-1.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/cloneSlideToAnotherPPT-1.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/cloneSlideToAnotherPPT-2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/cloneSlideToAnotherPPT-2.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/createSmartArtShape.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/createSmartArtShape.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/createTable.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/createTable.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/deleteComment.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/deleteComment.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/embedExcelAsOLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/embedExcelAsOLE.png -------------------------------------------------------------------------------- /Spire.Presentation/data/embedExcelAsOLE.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/embedExcelAsOLE.xlsx -------------------------------------------------------------------------------- /Spire.Presentation/data/encrypt.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/encrypt.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/extractImage.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/extractImage.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/extractText.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/extractText.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/fillShapeWithGradient.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/fillShapeWithGradient.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/fillShapeWithPicture.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/fillShapeWithPicture.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/formatChartDataLabels.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/formatChartDataLabels.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/headerAndFooter.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/headerAndFooter.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/hideSlide.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/hideSlide.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/indent.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/indent.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/insertAudio.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/insertAudio.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/insertImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/insertImage.png -------------------------------------------------------------------------------- /Spire.Presentation/data/insertImage.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/insertImage.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/insertVideo.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/insertVideo.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/markAsFinal.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/markAsFinal.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/mergeTableCell.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/mergeTableCell.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/openEncryptedPPT.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/openEncryptedPPT.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/presentationIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/presentationIcon.png -------------------------------------------------------------------------------- /Spire.Presentation/data/print.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/print.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/properties.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/properties.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/removeEncyption.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/removeEncyption.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/removeNode.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/removeNode.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/removeRowsAndColumns.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/removeRowsAndColumns.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/removeSlide.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/removeSlide.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/rotateShape.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/rotateShape.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/saveChartAsImage.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/saveChartAsImage.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setAlignmentInTable.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setAlignmentInTable.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setDatapointColorInChart.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setDatapointColorInChart.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setDocumentReadOnly.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setDocumentReadOnly.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setRowHeightColumnWidth.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setRowHeightColumnWidth.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setTableStyle.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setTableStyle.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setTransitions.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setTransitions.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/setbackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setbackground.png -------------------------------------------------------------------------------- /Spire.Presentation/data/setbackground.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/setbackground.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/shapeToImage.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/shapeToImage.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/toImage.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/toImage.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/toPDF.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/toPDF.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/toPPTX.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/toPPTX.ppt -------------------------------------------------------------------------------- /Spire.Presentation/data/toSVG.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/toSVG.pptx -------------------------------------------------------------------------------- /Spire.Presentation/data/toTIFF.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eiceblue/Spire.Office-for-Java/04826f2b2cdb2e9b77d15b8c972d7f9cdb5bcc9e/Spire.Presentation/data/toTIFF.pptx -------------------------------------------------------------------------------- /Spire.XLS/01_quick guide/helloWorld.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class helloWorld { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | //Get the first sheet 8 | Worksheet sheet = workbook.getWorksheets().get(0); 9 | sheet.get("A1").setText("Hello World"); 10 | 11 | sheet.get("A1").autoFitColumns(); 12 | 13 | String result = "output/helloWorld.xlsx"; 14 | 15 | //Save to file 16 | workbook.saveToFile(result, ExcelVersion.Version2010); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.XLS/01_quick guide/openExistingFile.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class openExistingFile { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | workbook.loadFromFile("data/templateAz2.xlsx"); 9 | 10 | //Add a new sheet, named MySheet 11 | Worksheet sheet = workbook.getWorksheets().add("MySheet"); 12 | 13 | //Get the reference of "A1" cell from the cells collection of a worksheet 14 | sheet.get("A1").setText("Hello World"); 15 | 16 | 17 | String result = "output/openExistingFile_result.xlsx"; 18 | 19 | //Save to file 20 | workbook.saveToFile(result, ExcelVersion.Version2010); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/02_data/copyCellsRange.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class copyCellsRange { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the Excel document from disk 9 | workbook.loadFromFile("data/CreateTable.xlsx"); 10 | 11 | //Get the first worksheet 12 | Worksheet sheet1 = workbook.getWorksheets().get(0); 13 | 14 | //Specify a destination range 15 | CellRange cells = sheet1.getRange().get("G1:H19"); 16 | 17 | //Copy the selected range to destination range 18 | sheet1.getRange().get("B1:C19").copy(cells); 19 | 20 | //String for output file 21 | String outputFile = "output/copyCellsRange_result.xlsx"; 22 | 23 | //Save the file 24 | workbook.saveToFile(outputFile, ExcelVersion.Version2013); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Spire.XLS/02_data/createTable.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class createTable { 4 | public static void main(String[] args) { 5 | //Create a workbook and load an Excel file from disk. 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/CreateTable.xlsx"); 8 | 9 | //Get the first worksheet. 10 | Worksheet sheet = workbook.getWorksheets().get(0); 11 | 12 | //Add a new List Object to the worksheet. 13 | sheet.getListObjects().create("table", sheet.getCellRange(1, 1, 19, 5)); 14 | 15 | //Add Default Style to the table. 16 | sheet.getListObjects().get(0).setBuiltInTableStyle(TableBuiltInStyles.TableStyleLight9); 17 | 18 | //Save to file. 19 | workbook.saveToFile("output/createTable_result.xlsx", ExcelVersion.Version2013); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/02_data/dataExport.java: -------------------------------------------------------------------------------- 1 | import com.spire.data.table.DataTable; 2 | import com.spire.xls.*; 3 | 4 | public class dataExport { 5 | public static void main(String[] args) { 6 | //Open xls document 7 | Workbook workbook = new Workbook(); 8 | workbook.loadFromFile("data/DataExport.xlsx"); 9 | //Get the first worksheet 10 | Worksheet sheet = workbook.getWorksheets().get(0); 11 | //Export to dataTable 12 | DataTable dataTable= sheet.exportDataTable(); 13 | int rows = dataTable.getRows().size(); 14 | int columns = dataTable.getColumns().size(); 15 | for (int i=0; i= 0; i--) 19 | { 20 | sheet.getPrstGeomShapes().get(i).remove(); 21 | } 22 | //save to file. 23 | workbook.saveToFile(output, ExcelVersion.Version2013); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Spire.XLS/10_shapes/deleteParticularShape.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class deleteParticularShape { 4 | public static void main(String[] args) throws Exception { 5 | String input = "data/Template_Xls_5.xlsx"; 6 | String output = "output/deleteParticularShape.xlsx"; 7 | 8 | //create a workbook. 9 | Workbook workbook = new Workbook(); 10 | 11 | //load the file from disk. 12 | workbook.loadFromFile(input); 13 | 14 | //get the first worksheet. 15 | Worksheet sheet = workbook.getWorksheets().get(0); 16 | 17 | //delete the first shape in the worksheet 18 | sheet.getPrstGeomShapes().get(0).remove(); 19 | 20 | //save to file. 21 | workbook.saveToFile(output, ExcelVersion.Version2013); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/11_formatting/applyBuiltInStyles.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class applyBuiltInStyles { 4 | public static void main(String[] args) throws Exception { 5 | String input = "data/SampleB_2.xlsx"; 6 | String output = "output/applyBuiltInStyles.xlsx"; 7 | 8 | //load the document from disk 9 | Workbook workbook = new Workbook(); 10 | workbook.loadFromFile(input); 11 | 12 | //get the first sheet 13 | Worksheet sheet = workbook.getWorksheets().get(0); 14 | 15 | //apply title style 16 | sheet.getCellRange("A1:J1").setBuiltInStyle( BuiltInStyles.Title); 17 | 18 | //save and launch result file 19 | workbook.saveToFile(output, ExcelVersion.Version2010); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/11_formatting/indentation.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class indentation { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Add a new worksheet to the Excel object 9 | Worksheet sheet = workbook.getWorksheets().get(0); 10 | 11 | //Access the "B5" cell from the worksheet 12 | CellRange cell = sheet.getCellRange("B5"); 13 | 14 | //Add some value to the "B5" cell 15 | cell.setText("Hello Spire!"); 16 | 17 | //Set the indentation level of the text (inside the cell) to 2 18 | cell.getStyle().setIndentLevel(2); 19 | 20 | //Save to file 21 | String result = "output/indentation_result.xlsx"; 22 | workbook.saveToFile(result, ExcelVersion.Version2013); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spire.XLS/11_formatting/textDirection.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class textDirection { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Add a new worksheet to the Excel object 9 | Worksheet sheet = workbook.getWorksheets().get(0); 10 | 11 | //Access the "B5" cell from the worksheet 12 | CellRange cell = sheet.getCellRange("B5"); 13 | 14 | //Add some value to the "B5" cell 15 | cell.setText("Hello Spire!"); 16 | 17 | //Set the reading order from right to left of the text in the "B5" cell 18 | cell.getStyle().setReadingOrder(ReadingOrderType.RightToLeft); 19 | 20 | //Save to file 21 | String result = "output/textDirection_result.xlsx"; 22 | workbook.saveToFile(result, ExcelVersion.Version2013); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spire.XLS/12_formulas/readFormulas.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class readFormulas { 4 | public static void main(String[] args) { 5 | String inputFile="data/readFormulas.xlsx"; 6 | 7 | Workbook workbook = new Workbook(); 8 | workbook.loadFromFile(inputFile); 9 | Worksheet sheet = workbook.getWorksheets().get(0); 10 | 11 | //Get the formula and value 12 | String formula = sheet.getCellRange("C14").getFormula(); 13 | double value = sheet.getCellRange("C14").getFormulaNumberValue(); 14 | 15 | //Print 16 | System.out.println("Formula: " + formula); 17 | System.out.println("value: " + value); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/14_hyperlink/readHyperlinks.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class readHyperlinks { 4 | public static void main(String[] args) { 5 | String inputFile="data/readHyperlinks.xlsx"; 6 | 7 | //Open xls document 8 | Workbook workbook = new Workbook(); 9 | workbook.loadFromFile( inputFile); 10 | //Get the first worksheet 11 | Worksheet sheet = workbook.getWorksheets().get(0); 12 | //Print out the comment 13 | System.out.println("The first link is " + sheet.getHyperLinks().get(0).getAddress()); 14 | System.out.println("The second link is " + sheet.getHyperLinks().get(1).getAddress()); 15 | System.out.println("The third link is " + sheet.getHyperLinks().get(2).getAddress()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.XLS/16_namedRanges/mergeNamedRangeCells.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | import com.spire.xls.core.*; 3 | 4 | public class mergeNamedRangeCells { 5 | public static void main(String[] args) { 6 | String inputFile="data/allNamedRanges.xlsx"; 7 | String outputFile="output/mergeNamedRangeCells_result.xlsx"; 8 | 9 | //Create a workbook and load the document from disk 10 | Workbook workbook = new Workbook(); 11 | workbook.loadFromFile(inputFile); 12 | 13 | //Get specific named range by index 14 | INamedRange NamedRange = workbook.getNameRanges().get(0); 15 | 16 | //Get the range of the named range 17 | IXLSRange range = NamedRange.getRefersToRange(); 18 | 19 | //Merge cells 20 | range.merge(); 21 | 22 | //Save the file 23 | workbook.saveToFile(outputFile, ExcelVersion.Version2010); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Spire.XLS/16_namedRanges/removeNamedRange.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class removeNamedRange { 4 | public static void main(String[] args) { 5 | String inputFile="data/allNamedRanges.xlsx"; 6 | String outputFile="output/removeNamedRange_result.xlsx"; 7 | 8 | //Create a workbook and load the document from disk 9 | Workbook workbook = new Workbook(); 10 | workbook.loadFromFile(inputFile); 11 | 12 | //Remove the named range by index 13 | workbook.getNameRanges().removeAt(0); 14 | 15 | //Remove the named range by name 16 | workbook.getNameRanges().remove("NameRange2"); 17 | 18 | //Save the file 19 | workbook.saveToFile(outputFile, ExcelVersion.Version2010); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/16_namedRanges/renameNamedRange.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class renameNamedRange { 4 | public static void main(String[] args) { 5 | String inputFile="data/allNamedRanges.xlsx"; 6 | String outputFile="output/renameNamedRange_result.xlsx"; 7 | 8 | //Create a workbook and load the document from disk 9 | Workbook workbook = new Workbook(); 10 | workbook.loadFromFile(inputFile); 11 | 12 | //Rename the named range 13 | workbook.getNameRanges().get(0).setName("RenameRange"); 14 | 15 | //Save the file 16 | workbook.saveToFile(outputFile, ExcelVersion.Version2010); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.XLS/18_pageSetup/setExcelPaperSize.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class setExcelPaperSize { 4 | public static void main(String[] args) { 5 | //Create a workbook. 6 | Workbook workbook = new Workbook(); 7 | 8 | //Get the first worksheet. 9 | Worksheet sheet = workbook.getWorksheets().get(0); 10 | 11 | //Set the paper size of the worksheet as A4 paper. 12 | sheet.getPageSetup().setPaperSize(PaperSizeType.PaperA4); 13 | 14 | String result = "output/setExcelPaperSize_result.xlsx"; 15 | 16 | //Save to file. 17 | workbook.saveToFile(result, ExcelVersion.Version2013); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/18_pageSetup/setFirstPageNumber.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class setFirstPageNumber { 4 | public static void main(String[] args) { 5 | String inputFile="data/template_Xls_4.xlsx"; 6 | String outputFile="output/setFirstPageNumber_result.xlsx"; 7 | 8 | Workbook workbook = new Workbook(); 9 | 10 | //Load the file from disk. 11 | workbook.loadFromFile(inputFile); 12 | 13 | //Get the first worksheet. 14 | Worksheet sheet = workbook.getWorksheets().get(0); 15 | 16 | //Set the first page number of the worksheet pages. 17 | sheet.getPageSetup().setFirstPageNumber(2); 18 | 19 | //Save to file. 20 | workbook.saveToFile(outputFile, ExcelVersion.Version2013); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.XLS/18_pageSetup/setPageOrientation.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class setPageOrientation { 4 | public static void main(String[] args) { 5 | String inputFile="data/template_Xls_4.xlsx"; 6 | String outputFile="output/setPageOrientation_result.xlsx"; 7 | 8 | //Create a workbook. 9 | Workbook workbook = new Workbook(); 10 | 11 | //Load the file from disk. 12 | workbook.loadFromFile(inputFile); 13 | 14 | //Get the first worksheet. 15 | Worksheet sheet = workbook.getWorksheets().get(0); 16 | 17 | //Set the page orientation to Landscape. 18 | sheet.getPageSetup().setOrientation(PageOrientationType.Landscape); 19 | 20 | //Save to file. 21 | workbook.saveToFile(outputFile, ExcelVersion.Version2013); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/18_pageSetup/setPrintQualityOfXlsFile.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class setPrintQualityOfXlsFile { 4 | public static void main(String[] args) { 5 | String inputFile="data/template_Xls_4.xlsx"; 6 | String outputFile="output/setPrintQualityOfXlsFile_result.xlsx"; 7 | 8 | //Create a workbook. 9 | Workbook workbook = new Workbook(); 10 | 11 | //Load the file from disk. 12 | workbook.loadFromFile(inputFile); 13 | 14 | //Get the first worksheet. 15 | Worksheet sheet = workbook.getWorksheets().get(0); 16 | 17 | //Set the print quality of the worksheet to 180 dpi. 18 | sheet.getPageSetup().setPrintQuality(180); 19 | 20 | //Save to file. 21 | workbook.saveToFile(outputFile, ExcelVersion.Version2013); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/19_pivotTables/disablePivotTableRibbon.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | import com.spire.xls.core.spreadsheet.pivottables.*; 3 | 4 | public class disablePivotTableRibbon { 5 | public static void main(String[] args) { 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load an excel file including pivot table 9 | workbook.loadFromFile("data/pivotTableExample.xlsx"); 10 | //Get the sheet in which the pivot table is located 11 | Worksheet sheet = workbook.getWorksheets().get("PivotTable"); 12 | 13 | XlsPivotTable pt = (XlsPivotTable) sheet.getPivotTables().get(0); 14 | //Disable ribbon for this pivot table 15 | pt.setEnableWizard(false); 16 | 17 | //Save to file 18 | String result = "output/disablePivotTableRibbon_result.xlsx"; 19 | workbook.saveToFile(result, ExcelVersion.Version2013); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.XLS/19_pivotTables/formatDataField.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | import com.spire.xls.core.spreadsheet.pivottables.*; 3 | 4 | public class formatDataField { 5 | public static void main(String[] args) { 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/formatDataField.xlsx"); 8 | Worksheet sheet = workbook.getWorksheets().get(0); 9 | 10 | // Access the PivotTable 11 | XlsPivotTable pt = (XlsPivotTable)sheet.getPivotTables().get(0); 12 | // Access the data field. 13 | PivotDataField pivotDataField = pt.getDataFields().get(0); 14 | // Set data display format 15 | pivotDataField.setShowDataAs(PivotFieldFormatType.PercentageOfColumn); 16 | 17 | String result = "output/formatDataField_result.xlsx"; 18 | workbook.saveToFile(result, ExcelVersion.Version2013); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Spire.XLS/19_pivotTables/hideAllItemOfPivotTable.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | import com.spire.xls.core.spreadsheet.pivottables.*; 3 | 4 | public class hideAllItemOfPivotTable { 5 | public static void main(String[] args) { 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/pivotTable.xlsx"); 8 | Worksheet sheet = workbook.getWorksheets().get(0); 9 | 10 | XlsPivotTable pivotTable = (XlsPivotTable)sheet.getPivotTables().get(0); 11 | PivotField pivotField = (PivotField)pivotTable.getPivotFields().get("Product"); 12 | pivotField.hideAllItem(true); 13 | 14 | pivotTable.calculateData(); 15 | 16 | workbook.saveToFile("output/hideAllItemOfPivotTable.xlsx",FileFormat.Version2013); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.XLS/21_security/detectProtection.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class detectProtection { 4 | public static void main(String[] args) { 5 | // Load the document from disk 6 | String input = "data/protectedWorkbook.xlsx"; 7 | // Detect if the Excel workbook is password protected 8 | boolean value = Workbook.bookIsPasswordProtected(input); 9 | 10 | if (value) { 11 | System.out.println("This excel workbook is password protected."); 12 | } else { 13 | System.out.println("This excel workbook is not password protected."); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.XLS/21_security/hideFormulas.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class hideFormulas { 4 | public static void main(String[] args)throws Exception { 5 | String input = "data/FormulasSample.xlsx"; 6 | String output = "output/hideFormulas.xlsx"; 7 | 8 | //create a workbook 9 | Workbook workbook = new Workbook(); 10 | 11 | //load the document from disk 12 | workbook.loadFromFile(input); 13 | 14 | //get the first worksheet 15 | Worksheet sheet = workbook.getWorksheets().get(0); 16 | 17 | //hide the formulas in the used range 18 | sheet.getAllocatedRange().isFormulaHidden(true); 19 | 20 | //protect the worksheet with password 21 | sheet.protect("e-iceblue"); 22 | 23 | //save the document 24 | workbook.saveToFile(output, ExcelVersion.Version2013); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Spire.XLS/21_security/protectCell.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | import com.spire.xls.*; 4 | 5 | public class protectCell { 6 | public static void main(String[] args) { 7 | //Create a workbook and load a file 8 | Workbook workbook = new Workbook(); 9 | workbook.loadFromFile("data/protectCell.xlsx"); 10 | 11 | //Get the first worksheet 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | //Protect cell 15 | sheet.getRange().get("B3").getStyle().setLocked(true); 16 | sheet.getRange().get("C3").getStyle().setLocked(false); 17 | 18 | sheet.protect("TestPassword", EnumSet.of(SheetProtectionType.All)); 19 | 20 | //Save the document and launch it 21 | String result = "output/protectCell_result.xlsx"; 22 | workbook.saveToFile(result, ExcelVersion.Version2013); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spire.XLS/21_security/protectWorkbook.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class protectWorkbook { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the document from disk 9 | workbook.loadFromFile("data/worksheetSample1.xlsx"); 10 | 11 | //Protect Workbook 12 | workbook.protect("e-iceblue"); 13 | 14 | //Save the document 15 | String output = "output/protectWorkbook_result.xlsx"; 16 | workbook.saveToFile(output, ExcelVersion.Version2013); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.XLS/21_security/unlockProtectSheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class unlockProtectSheet { 4 | public static void main(String[] args) { 5 | //Create a workbook. 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the file from disk. 9 | workbook.loadFromFile("data/UnprotectProtectSheet.xlsx"); 10 | 11 | //Get the first worksheet. 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | //Unprotect the worksheet with password. 15 | sheet.unprotect("e-iceblue"); 16 | 17 | String result = "output/UnprotectProtectSheet_out.xlsx"; 18 | 19 | //Save to file. 20 | workbook.saveToFile(result, ExcelVersion.Version2013); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/21_security/unlockSimpleSheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class unlockSimpleSheet { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the file from disk 9 | workbook.loadFromFile("data/template_Xls_4.xlsx"); 10 | 11 | //Get the first worksheet 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | //Unlock the worksheet in a unlocked Excel file with null string 15 | sheet.unprotect(); 16 | 17 | //Save to file 18 | String result = "output/unlockSimpleSheet_result.xlsx"; 19 | workbook.saveToFile(result, ExcelVersion.Version2013); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/activateWorksheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class activateWorksheet { 4 | public static void main(String[] args) { 5 | // Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | // Load the document from disk 9 | workbook.loadFromFile("data/worksheetSample2.xlsx"); 10 | 11 | // Get the second worksheet from the workbook 12 | Worksheet sheet = workbook.getWorksheets().get(1); 13 | 14 | // Activate the sheet 15 | sheet.activate(); 16 | 17 | // Save the document 18 | String output = "output/activateWorksheet_result.xlsx"; 19 | workbook.saveToFile(output, ExcelVersion.Version2013); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/addPageBreakInXlsFile.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class addPageBreakInXlsFile { 4 | public static void main(String[] args) { 5 | // Create a workbook. 6 | Workbook workbook = new Workbook(); 7 | 8 | // Load the file from disk. 9 | workbook.loadFromFile("data/template_Xls_4.xlsx"); 10 | 11 | // Get the first worksheet. 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | // Add page break in Excel file. 15 | sheet.getHPageBreaks().add(sheet.getRange().get("E4")); 16 | sheet.getVPageBreaks().add(sheet.getRange().get("C4")); 17 | 18 | String result = "output/addPageBreakInXlsFile_result.xlsx"; 19 | 20 | // Save to file. 21 | workbook.saveToFile(result, ExcelVersion.Version2013); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/addWorksheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class addWorksheet { 4 | public static void main(String[] args) { 5 | // Load a Workbook from disk 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/addWorksheet.xlsx"); 8 | 9 | // Add a new worksheet named AddedSheet 10 | Worksheet sheet = workbook.getWorksheets().add("AddedSheet"); 11 | sheet.getRange().get("C5").setText("This is a new sheet."); 12 | 13 | // Save to file 14 | String output = "output/addWorksheet_result.xlsx"; 15 | workbook.saveToFile(output, ExcelVersion.Version2013); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/filteredValueToCSV.java: -------------------------------------------------------------------------------- 1 | package worksheets; 2 | 3 | import com.spire.xls.*; 4 | 5 | public class filteredValueToCSV { 6 | public static void main(String[] args) throws Exception { 7 | String input = "data/FilteredSample.xlsx"; 8 | String output = "output/filteredValueToCSV.csv"; 9 | 10 | //create a workbook 11 | Workbook workbook = new Workbook(); 12 | 13 | //load the document from disk 14 | workbook.loadFromFile(input); 15 | 16 | //get the first worksheet from the workbook 17 | Worksheet sheet = workbook.getWorksheets().get(0); 18 | 19 | //save to csv file 20 | sheet.saveToFile(output, " ", false); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/freezePanes.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class freezePanes { 4 | public static void main(String[] args) { 5 | //Load a Workbook from disk 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/freezePanes.xlsx"); 8 | 9 | //Get the first sheet 10 | Worksheet sheet = workbook.getWorksheets().get(0); 11 | 12 | //Freeze Top Row 13 | sheet.freezePanes(2, 1); 14 | 15 | //Save and Launch 16 | String output = "output/freezePanes_result.xlsx"; 17 | workbook.saveToFile(output, ExcelVersion.Version2013); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/getGroupBoxes.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | import com.spire.xls.core.IGroupBoxes; 3 | 4 | public class getGroupBoxes { 5 | public static void main(String[] args) { 6 | String inputFile = "data/groupBox.xlsx"; 7 | // Create a workbook 8 | Workbook workbook = new Workbook(); 9 | //Load the document from disk 10 | workbook.loadFromFile(inputFile); 11 | //Get the first worksheet 12 | Worksheet worksheet = workbook.getWorksheets().get(0); 13 | //Get the group box collection 14 | IGroupBoxes groupBoxs = worksheet.getGroupBoxes(); 15 | for (int i = 0; i < groupBoxs.getCount(); i++) { 16 | String name = groupBoxs.get(i).getName(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/hideOrShowWorksheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class hideOrShowWorksheet { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the document from disk 9 | workbook.loadFromFile("data/worksheetSample3.xlsx"); 10 | 11 | //Hide the sheet named "Sheet1" 12 | workbook.getWorksheets().get("Sheet1").setVisibility(WorksheetVisibility.Hidden); 13 | 14 | //Show the second sheet 15 | workbook.getWorksheets().get(1).setVisibility(WorksheetVisibility.Visible); 16 | 17 | //Save the document 18 | String output = "output/hideOrShowWorksheet_result.xlsx"; 19 | workbook.saveToFile(output, ExcelVersion.Version2013); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/hideTab.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | public class hideTab { 3 | public static void main(String[] args) { 4 | //Create a workbook 5 | Workbook workbook = new Workbook(); 6 | 7 | //Load the document from disk 8 | workbook.loadFromFile("data/WorksheetSample2.xlsx"); 9 | 10 | //Hide worksheet tab 11 | workbook.setShowTabs(false); 12 | 13 | //Save the document 14 | String output = "output/HideTab_out.xlsx"; 15 | workbook.saveToFile(output, ExcelVersion.Version2013); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/hideZeroValues.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class hideZeroValues { 4 | public static void main(String[] args) throws Exception { 5 | String input = "data/sampleB_2.xlsx"; 6 | String output = "output/hideZeroValues.xlsx"; 7 | 8 | //create a workbook 9 | Workbook workbook = new Workbook(); 10 | 11 | //load the document from disk 12 | workbook.loadFromFile(input); 13 | 14 | //get the first sheet 15 | Worksheet sheet = workbook.getWorksheets().get(0); 16 | 17 | //set false to hide the zero values in sheet 18 | sheet.isDisplayZeros(false); 19 | 20 | //save the file 21 | workbook.saveToFile(output, ExcelVersion.Version2013); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/moveWorksheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class moveWorksheet { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the document from disk 9 | workbook.loadFromFile("data/worksheetSample2.xlsx"); 10 | 11 | //Get the first worksheet 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | //Move worksheet 15 | sheet.moveWorksheet(2); 16 | 17 | //Save the document 18 | String output = "output/moveWorksheet_result.xlsx"; 19 | workbook.saveToFile(output, ExcelVersion.Version2013); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/pageBreakPreview.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class pageBreakPreview { 4 | public static void main(String[] args) { 5 | //Create a workbook. 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the file from disk. 9 | workbook.loadFromFile("data/template_Xls_4.xlsx"); 10 | 11 | //Get the first worksheet. 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | //Set the scale of PageBreakView mode in Excel file. 15 | sheet.setZoomScalePageBreakView(80); 16 | 17 | String result = "output/pageBreakPreview_result.xlsx"; 18 | 19 | //Save to file. 20 | workbook.saveToFile(result, ExcelVersion.Version2013); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/removeWorksheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class removeWorksheet { 4 | public static void main(String[] args) { 5 | //Create a workbook and load a file 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/removeWorksheet.xlsx"); 8 | 9 | //Remove a worksheet by sheet index 10 | workbook.getWorksheets().removeAt(1); 11 | 12 | //Save the document 13 | String output = "output/removeWorksheet_result.xlsx"; 14 | workbook.saveToFile(output, ExcelVersion.Version2013); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/setViewMode.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class setViewMode { 4 | public static void main(String[] args) { 5 | //Create a workbook and load a file 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/setViewMode.xlsx"); 8 | 9 | //Set the view mode 10 | workbook.getWorksheets().get(0).setViewMode(ViewMode.Preview); 11 | 12 | //Save the document 13 | String output = "output/setViewMode_result.xlsx"; 14 | workbook.saveToFile(output, ExcelVersion.Version2013); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/showTab.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | public class showTab { 3 | public static void main(String[] args) { 4 | //Create a workbook 5 | Workbook workbook = new Workbook(); 6 | 7 | //Load the document from disk 8 | workbook.loadFromFile("data/WorksheetSample4.xlsx"); 9 | 10 | //Show worksheet tab 11 | workbook.setShowTabs(true); 12 | 13 | //Save the document 14 | String output = "output/ShowTab_out.xlsx"; 15 | workbook.saveToFile(output, ExcelVersion.Version2013); 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/unfreezeExcelPanes.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class unfreezeExcelPanes { 4 | public static void main(String[] args) { 5 | // Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | // Load the file from disk 9 | workbook.loadFromFile("data/template_Xls_2.xlsx"); 10 | 11 | // Get the first worksheet. 12 | Worksheet sheet = workbook.getWorksheets().get(0); 13 | 14 | // Unfreeze the panes 15 | sheet.removePanes(); 16 | 17 | // Save the document 18 | String output = "output/unfreezeExcelPanes_result.xlsx"; 19 | workbook.saveToFile(output, ExcelVersion.Version2013); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/verifyProtectedWorksheet.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class verifyProtectedWorksheet { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the Excel document from disk 9 | workbook.loadFromFile("data/protectedWorksheet.xlsx"); 10 | 11 | //Get the first worksheet 12 | Worksheet worksheet = workbook.getWorksheets().get(0); 13 | 14 | //Verify the first worksheet 15 | boolean detect = worksheet.isPasswordProtected(); 16 | 17 | //Print the result 18 | System.out.println("The first worksheet is password protected or not: " + (detect == true ? "Yes!" : "No!")); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Spire.XLS/23_worksheets/zoomFactor.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class zoomFactor { 4 | public static void main(String[] args) { 5 | //Create a workbook and load a file 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/zoomFactor.xlsx"); 8 | 9 | //Get the first worksheet 10 | Worksheet sheet = workbook.getWorksheets().get(0); 11 | 12 | //Set the zoom factor of the sheet to 85 13 | sheet.setZoom(85); 14 | 15 | //Save the document and launch it 16 | String output = "output/zoomFactor_result.xlsx"; 17 | workbook.saveToFile(output, ExcelVersion.Version2013); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/decryptWorkbook.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class decryptWorkbook { 4 | public static void main(String[] args) { 5 | String fileName = "data/decryptWorkbook.xlsx"; 6 | 7 | //Detect if the Excel workbook is password protected. 8 | boolean value = Workbook.bookIsPasswordProtected(fileName); 9 | 10 | if (value) { 11 | //Load a file with the password specified 12 | Workbook workbook = new Workbook(); 13 | workbook.setOpenPassword("eiceblue"); 14 | workbook.loadFromFile(fileName); 15 | 16 | //Decrypt workbook 17 | workbook.unProtect(); 18 | 19 | //Save the document 20 | String output = "output/decryptWorkbook_result.xlsx"; 21 | workbook.saveToFile(output, ExcelVersion.Version2013); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/detectExcelVersion.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | import java.io.File; 4 | 5 | public class detectExcelVersion { 6 | public static void main(String[] args) { 7 | //Files 8 | String[] files = new String[] { "data/ExcelSample97_N.xls", "data/WorksheetSample4.xlsx", "data/ExcelSample_N.xlsb" }; 9 | 10 | for (String file : files) { 11 | //Create a workbook 12 | Workbook workbook = new Workbook(); 13 | 14 | //Load the document 15 | workbook.loadFromFile(file); 16 | 17 | //Get the version 18 | ExcelVersion version = workbook.getVersion(); 19 | 20 | System.out.println(version); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/detectVBAMacros.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class detectVBAMacros { 4 | public static void main(String[] args) { 5 | // Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | // Load the document from disk 9 | workbook.loadFromFile("data/macroSample.xls"); 10 | 11 | // Detect if the Excel file contains VBA macros 12 | boolean hasMacros = workbook.hasMacros(); 13 | if (hasMacros) { 14 | System.out.println("This Excel document contains VBA macros."); 15 | } else { 16 | System.out.println("This Excel document doesn't contain VBA macros."); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/encryptWorkbook.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class encryptWorkbook { 4 | public static void main(String[] args) { 5 | //Create a workbook and load a file 6 | Workbook workbook = new Workbook(); 7 | workbook.loadFromFile("data/encryptWorkbook.xlsx"); 8 | 9 | //Protect Workbook with the password you want 10 | workbook.protect("eiceblue"); 11 | 12 | //Save the document and launch it 13 | String output = "output/encryptWorkbook_result.xlsx"; 14 | workbook.saveToFile(output, ExcelVersion.Version2013); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/loadAndSaveFileWithMacro.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class loadAndSaveFileWithMacro { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the document from disk 9 | workbook.loadFromFile("data/macroSample.xls"); 10 | 11 | Worksheet sheet = workbook.getWorksheets().get(0); 12 | 13 | sheet.getRange().get("A5").setText("This is a simple test!"); 14 | 15 | //Save the document 16 | String output = "output/loadAndSaveFileWithMacro_result.xls"; 17 | workbook.saveToFile(output, ExcelVersion.Version97to2003); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/readStream.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | import com.spire.xls.*; 4 | 5 | public class readStream { 6 | public static void main(String[] args) throws Exception { 7 | Workbook workbook = new Workbook(); 8 | 9 | //Open excel from a stream 10 | FileInputStream fileStream = new FileInputStream("data/readStream.xlsx"); 11 | 12 | workbook.loadFromStream(fileStream); 13 | 14 | String output = "output/readStream_result.xlsx"; 15 | workbook.saveToFile(output, ExcelVersion.Version2013); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/removeCustomProperties.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | import com.spire.xls.core.*; 3 | 4 | public class removeCustomProperties { 5 | public static void main(String[] args) { 6 | //Create a workbook 7 | Workbook workbook = new Workbook(); 8 | 9 | //Load a excel document 10 | workbook.loadFromFile("data/templateAz.xlsx"); 11 | 12 | //Retrieve a list of all custom document properties of the Excel file 13 | ICustomDocumentProperties customDocumentProperties = workbook.getCustomDocumentProperties(); 14 | 15 | //Remove "Editor" custom document property 16 | customDocumentProperties.remove("Editor"); 17 | 18 | String result = "output/removeCustomProperties_result.xlsx"; 19 | //Save to file 20 | workbook.saveToFile(result, ExcelVersion.Version2013); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/saveStream.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | import com.spire.xls.*; 4 | 5 | public class saveStream { 6 | public static void main(String[] args) throws Exception { 7 | Workbook workbook = new Workbook(); 8 | workbook.loadFromFile("data/saveStream.xls"); 9 | 10 | //Save an excel workbook to stream 11 | FileOutputStream fileStream = new FileOutputStream("output/saveStream_result.xlsx"); 12 | workbook.saveToStream(fileStream, FileFormat.Version2013); 13 | 14 | fileStream.close(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Spire.XLS/24_workbook/setExcelCalculationMode.java: -------------------------------------------------------------------------------- 1 | import com.spire.xls.*; 2 | 3 | public class setExcelCalculationMode { 4 | public static void main(String[] args) { 5 | //Create a workbook 6 | Workbook workbook = new Workbook(); 7 | 8 | //Load the Excel document from disk 9 | workbook.loadFromFile("data/createTable.xlsx"); 10 | 11 | //Set excel calculation mode as Manual 12 | workbook.setCalculationMode(ExcelCalculationMode.Manual); 13 | 14 | //String for output file 15 | String outputFile = "output/setExcelCalculationMode_result.xlsx"; 16 | 17 | //Save the file 18 | workbook.saveToFile(outputFile, ExcelVersion.Version2013); 19 | } 20 | } 21 | --------------------------------------------------------------------------------