Quantcast
Channel: Aspose.Pdf for Java
Viewing all 47 articles
Browse latest View live

Aspose.Pdf for Java 4.5.1

$
0
0
We are pleased to announce the release of latest hotfix containing resolution of some high priority issues.

New Features
  • PDFNEWJAVA-33855  Complete porting of Aspose.Pdf.New.generator
  • PDFNEWJAVA-33946  Setting font path for more than one fonts
Bugs
  • PDFNEWJAVA-33785 - Problem using component with Hadoop
  • PDFNEWJAVA-33846 - PDF to Image conversion loses dotted lines
  • PDFNEWJAVA-33840 - PDF to TIFF - contents are missing in reusltant file
  • PDFNEWJAVA-33858 - Portfolio feature is malfunctioning while setting file description through FileSpecification object
  • PDFNEWJAVA-33841 - PDF to JPEG - Exception is being generated

Aspose.Pdf for Java 2.9.0

$
0
0

Introduction:

We are pleased to announce the release of another version of Aspose.Pdf for Java which includes fixes for the issues reported earlier. Numerous issues regarding HTML to PDF conversion and word spacing have been fixed in this release.

What's fixed ?

 

The main bugs fixed are listed as following:

Aspose.Pdf for Java 4.6.0

$
0
0



We are introducing another release which contains some new features and resolution to some high priority issues.

New Features
  • PDFNEWJAVA-33462 - SVG to PDF conversion
Enhancement
  • PDFNEWJAVA-33908 - Remove unused objects from PDF file
  • PDFNEWJAVA-33958 - Synchronize Java project with .Net project
  • PDFNEWJAVA-34036 - Establishment of a unified documentation file for the packages aspose.pdf.* and com.aspose.pdf.*
Bugs
  • PDFNEWJAVA-33913 - Annotation is removed when creating NUP of PDF file
  • PDFNEWJAVA-33795 - Concurrency issue with Aspose.PDF library in image extraction from PDF files
  • PDFNEWJAVA-33907 - Spliting the PDF to pages produces same size files
  • PDFNEWJAVA-33828 - Incorrect font name being returned
  • PDFNEWJAVA-33383 - Gif to Pdf conversion process hangs for indefinite time
  • PDFNEWJAVA-33812 - HTML to PDF: Conversion throws AbstractMethodErro exception.
  • PDFNEWJAVA-33835 - Footer does not appear in Even pages
  • PDFNEWJAVA-33859 - XPS to PDF conversion throws exception in class com.aspose.ms.System.d
Investigations (Not a Bug):
  • PDFNEWJAVA-34054 Incorrect page count before saving new PDF document
  • PDFNEWJAVA-33899 BinaryFileStream class is missing from aspose.pdf package
Public API and Backwards Incompatible Changes:

Establishment of a unified documentation file for the packages aspose.pdf.* and com.aspose.pdf.*

Java documentation for the package aspose.pdf.* were added to the release in the file aspose-pdf-javadoc.jar

Remove unused objects from PDF file

Usecase:
com.aspose.pdf.Document doc = new Document("source.pdf");
OptimizationOptions opt = new Document.OptimizationOptions();
opt.setRemoveUnusedObjects(true);opt.setRemoveUnusedStreams(true);
doc.optimizeResources(opt);
doc.save("optimized.pdf");

SVG to PDF conversion

SVG to PDF conversion in Aspose.Pdf for Java.

Usecase:

String file = "Document.svg";//stream svg to pdf not supported yet LoadOptions options = new SvgLoadOptions();
 Document document = new Document(file, options);
 document.save("Result.pdf");

Synchronized Java project with .Net project

Moved:

com.aspose.pdf.facades.PageSize - to: com.aspose.pdf.PageSize

com.aspose.doc.wordcore.DocConverter - to: com.aspose.pdf.DocConverter

com.aspose.pdf.ITable  - to: com.aspose.pdf.generator.legacyxmlmodel.ITable 

com.aspose.pdf.ITableCell  - to: com.aspose.pdf.generator.legacyxmlmodel.ITableCell 

com.aspose.pdf.ITableRow  - to: com.aspose.pdf.generator.legacyxmlmodel.ITableRow 

Added:

package com.aspose.pdf.drawing 

and the next classes:

com.aspose.pdf.drawing.Arc 

com.aspose.pdf.drawing.Circle 

com.aspose.pdf.drawing.Curve 

com.aspose.pdf.drawing.Graph 

com.aspose.pdf.drawing.Line 

com.aspose.pdf.drawing.Rectangle 

com.aspose.pdf.drawing.Shape 

Added:

package com.aspose.pdf.excel

and the next classes:

com.aspose.pdf.excel.ColumnManager 

com.aspose.pdf.excel.ContentManager 

com.aspose.pdf.excel.DataKeeper 

com.aspose.pdf.excel.DataManager 

com.aspose.pdf.excel.ExcelConverterInternal 

com.aspose.pdf.excel.ItemPropertyStore 

com.aspose.pdf.excel.Log 

com.aspose.pdf.excel.OverrideContentManager 

com.aspose.pdf.excel.RegexManager 

com.aspose.pdf.excel.SpreadSheetManager 

com.aspose.pdf.excel.SSCell 

com.aspose.pdf.excel.SSColumn 

com.aspose.pdf.excel.SSConvertToXml 

com.aspose.pdf.excel.SSFileComponents 

com.aspose.pdf.excel.SSFont 

com.aspose.pdf.excel.SSRow 

com.aspose.pdf.excel.SSStyle 

com.aspose.pdf.excel.SSTable 

com.aspose.pdf.excel.SSWorkbook 

com.aspose.pdf.excel.SSWorksheet 

Added classes:

com.aspose.pdf.exceptions.FontNotFoundException 

com.aspose.pdf.generator.legacyxmlmodel.enums.InconsistentXmlImageParamsHandlingTypes 

com.aspose.pdf.text.FontTypes 

com.aspose.pdf.text.TextProcessingContext 

com.aspose.pdf.EpubConverter 

com.aspose.pdf.EpubLoadOptions 

com.aspose.pdf.EpubSaveOptions 

com.aspose.pdf.ExcelConverter 

com.aspose.pdf.ExcelSaveOptions 

com.aspose.pdf.FolderFontSource 

com.aspose.pdf.GraphInfo 

com.aspose.pdf.HtmlDocumentType 

com.aspose.pdf.InvalidFormTypeOperationException 

com.aspose.pdf.IWarningCallback 

com.aspose.pdf.LatexLoadOptions 

com.aspose.pdf.LatexToPdfConverter 

com.aspose.pdf.MhtMainHtmlPart 

com.aspose.pdf.MhtParcedPackage 

com.aspose.pdf.MhtPart 

com.aspose.pdf.MhtResourcePart 

com.aspose.pdf.MhtToPdfConverter 

com.aspose.pdf.MhtUtility 

com.aspose.pdf.MobiXmlConverter 

com.aspose.pdf.MobiXmlSaveOptions 

com.aspose.pdf.ReturnAction 

com.aspose.pdf.SvgConverter 

com.aspose.pdf.WarningInfo 

com.aspose.pdf.WarningType 

Changes in the next classes:

com.aspose.pdf.facades.AForm

was extended from SaveableFacade

added:

 internal public static class FormImportResult

 public FormImportResult[] getImportResult()

 public void importXml(InputStream inputXmlStream)

 public void extractXfaData(OutputStream outputXmlStream)

 public void setXfaData(InputStream inputXmlStream)

 public boolean isRequiredField(String fieldName)

 public void importXml(InputStream inputXmlStream, boolean IgnoreFormTemplateChanges)

next methods were marked as @Deprecated:

 public String getSrcFileName() 

 public void setSrcFileName(String value)

 public String getDestFileName() 

 public AForm(String srcFileName, String destFileName)

 public AForm(String srcFileName, OutputStream destStream)

 public AForm(InputStream srcStream, String destFileName)

 public AForm(IDocument document, String destFileName)

com.aspose.pdf.facades.AFormEditor 

added:

 public double getRadioButtonItemSize()

 public void setRadioButtonItemSize(double value)

 public  int getFieldAppearance(String fieldName)

 public boolean addFieldScript(String fieldName, String script)

  

next methods were marked as @Deprecated:

 public String getSrcFileName() 

 public void setSrcFileName(String value)

 public String getDestFileName() 

 public void setDestFileName(String value)

 public AFormEditor(String srcFileName, String destFileName)

 public void save()

 public AFormEditor(IDocument document, String destFileName)

com.aspose.pdf.facades.AlignmentType 

class was marked as @Deprecated 

added:

 public  String toString()

com.aspose.pdf.facades.APdfFileEditor 

added:
 public String getConversionLog()
 public boolean getMergeDuplicateLayers()
 public void setMergeDuplicateLayers(boolean value)
 public boolean getMergeDuplicateOutlines()
 public void setMergeDuplicateOutlines(boolean value)
 public boolean getPreserveUserRights()
 public void setPreserveUserRights(boolean value)
 public boolean getIncrementalUpdates()
 public void setIncrementalUpdates(boolean value)
 public boolean getOptimizeSize()
 public void setOptimizeSize(boolean value)
 public static ContentsResizeParameters pageResize(double width, double height)
 public static ContentsResizeParameters pageResizePct(double widthPct, double heightPct)
 public boolean concatenate(Document[] src, Document dest)
 public void splitToPages(String inputFile, String fileNameTemplate)
 public void splitToPages(InputStream inputStream, String fileNameTemplate)

com.aspose.pdf.facades.APdfFileStamp 

added:
 public boolean getOptimizeSize()
 public void setOptimizeSize(boolean value)
 public int getStampId()
 public void setStampId(int value)

com.aspose.pdf.facades.AutoFiller 

implements ISaveableFacade
 
next methods were marked as @Deprecated:
 void setOutputStreamInternal(Stream value)
 public String getInputFileName() 
 public void setInputFileName(String value)
 public String getOutputFileName() 
 public void setOutputFileName(String value)
 public void save()
 
added:
 public InputStream getInputStream() 
 public void setInputStream(InputStream value)
 public void save(String destFile)
 public void save(OutputStream destStream)
 public void bindPdf(String srcFile)
 public void bindPdf(InputStream srcStream)
 public void bindPdf(IDocument srcDoc)
 public void close()
 

com.aspose.pdf.facades.Facade 

added:
 public  void bindPdf(InputStream srcStream, String password)

com.aspose.pdf.facades.Form 

added:

 internal public static  final class ImportStatus

com.aspose.pdf.facades.FormFieldFacade 

 next constant were marked as @Deprecated:
 public static final float BORDER_WIDTH_UNDIFIED = 0;
 
 added:
 public static final float BORDER_WIDTH_UNDEFINED = -1;
 

com.aspose.pdf.facades.PdfAnnotationEditor 

 extends SaveableFacade

 added:

 public void importAnnotationFromXfdf(InputStream xfdfSteam, int[] annotType)

 public void importAnnotationFromXfdf(InputStream xfdfSteam)

 public void exportAnnotationsXfdf(OutputStream xmlOutputStream, int start, int end, String[] annotTypes)

 public void exportAnnotationsXfdf(OutputStream xmlOutputStream, int start, int end, int[] annotTypes)

com.aspose.pdf.facades.PdfBookmarkEditor 

extends SaveableFacade

com.aspose.pdf.facades.PdfConverter 

added:

 public boolean getShowHiddenAreas()

 public void setShowHiddenAreas(boolean value)

com.aspose.pdf.facades.PdfFileEditor 

added:

 public static final String E_EMPTY_PAGE_RANGE = "Page ranges array is not set";

 public static final String E_SMALL_PAGE_RANGE = "Page range array must have two elements";

 public static final String E_WRONG_PAGE_RANGE = "Invalid page range";

 public boolean concatenate(Document[] src, Document dest)

 public boolean resizeContents(InputStream source, OutputStream destination, int[] pages, ContentsResizeParameters parameters)

 public boolean resizeContents(InputStream source, OutputStream destination, int[] pages, 

 public boolean resizeContentsPct(InputStream source, OutputStream destination, int[] pages, double newWidth, double newHeight)

 public boolean addMargins(InputStream source, OutputStream destination, int[] pages, double leftMargin, double rightMargin, double topMargin, double bottomMargin)

 public boolean addMarginsPct(InputStream source, OutputStream destination, int[] pages, double leftMargin, double rightMargin, double topMargin, double bottomMargin)

com.aspose.pdf.facades.PdfFileInfo 

extends SaveableFacade

added:

 public java.util.Map getHeader() 

 public void setHeader(java.util.Map value) 

 public void save(OutputStream destStream)  

next constant were marked as @Deprecated:

 public String getInputFile() 

 public void setInputFile(String value)

 public InputStream getInputStream() 

 public void setInputStream(InputStream value)

com.aspose.pdf.facades.PdfFileSecurity 

extends SaveableFacade  

next methods were marked as @Deprecated:

 public void setOutputFile(String value) 

 public PdfFileSecurity(String inputFile, String outputFile)

 public PdfFileSecurity(IDocument document, String outputFile) 

 public PdfFileSecurity(IDocument document, OutputStream outputStream) 

added:

 public void bindPdf(String srcFile)

 public void bindPdf(InputStream srcStream)

 public void close()

com.aspose.pdf.facades.PdfFileSignature 

extends SaveableFacade 

next constant were marked as @Deprecated:

 public PdfFileSignature(String inputFile)

 public PdfFileSignature(String inputFile, String outputFile)

 public void save() 

added:

 public void removeSignature(String signName, boolean removeField) 

 public java.util.Date getDateTime(String signName)

com.aspose.pdf.facades.PdfPageEditor 

added:

 public java.util.Map getPageRotations()

 public java.util.Map getPageRotations()

 public int getHorizontalAlignment() 

 public void setHorizontalAlignment(int value)

 public int getVerticalAlignmentType() 

 public void setVerticalAlignmentType(int value)

 public java.awt.Rectangle getPageBoxSize(int page, String pageBoxName)

 public void applyChanges() 

next constant were marked as @Deprecated:

 public AlignmentType getAlignment()

 public void setAlignment(AlignmentType value)

 public VerticalAlignmentType getVerticalAlignment()

 public void setVerticalAlignment(VerticalAlignmentType value) 

removed:

 public void setAlignment(AlignmentType value)

com.aspose.pdf.facades.PdfViewer 

added:
 public boolean getShowHiddenAreas()

 public void setShowHiddenAreas(boolean value)

 public int getCopiesPrinted()

 public void printLargePdf(InputStream inputStream, PrinterSettings printerSettings)

 public void printLargePdf(InputStream inputStream, PageSettings pageSettings, PrinterSettings printerSettings)

 public void bindPdf(InputStream srcStream)

com.aspose.pdf.facades.VerticalAlignmentType 

was marked as @Deprecated

com.aspose.pdf.generator.legacyxmlmodel.EndNote 

renamed:
 getNumberingContinuation_EndNote_New() to getNumberingContinuation()
 setNumberingContinuation_EndNote_New() to setNumberingContinuation()

com.aspose.pdf.generator.legacyxmlmodel.Image 

added:
 public  void load(XmlTextReader xmlReader, LoadingContext context)

com.aspose.pdf.generator.legacyxmlmodel.LegacyPdf 

added:

 public int InconsistentXmlImageParamsHandlingType;

com.aspose.pdf.generator.legacyxmlmodel.Table 

added:

 public int getColumnCount()

com.aspose.pdf.text.Font 

removed since it dublicates com.aspose.pdf.Font 

com.aspose.pdf.ADocument 

added:

 public boolean isPdfaCompliant()

 public int getPdfaFormat() 

com.aspose.pdf.Annotation 

added:

 public int getHorizontalAlignment_Annotation_New() 

 public void setHorizontalAlignment_Annotation_New(int value)

next constant were marked as @Deprecated:

 public int getAlignment() 

 public void setAlignment(int value)

com.aspose.pdf.AnnotationActionCollection 

added:

 public PdfAction getOnModifyCharacter()

 public void setOnModifyCharacter(PdfAction value)

 public PdfAction getOnValidate()

 public void setOnValidate(PdfAction value)

 public PdfAction getOnFormat()

 public void setOnFormat(PdfAction value)

 public PdfAction getOnCalculate()

 public void setOnCalculate(PdfAction value)

com.aspose.pdf.ApsToPdfConverter 

added:

 public  void visitFormFieldButton(ApsButton field)

com.aspose.pdf.BackgroundArtifact 

added:

  public java.awt.Color getBackgroundColor()

  public void setBackgroundColor(java.awt.Color value)

com.aspose.pdf.BaseParagraph 

added:

 public int getHorizontalAlignment()

com.aspose.pdf.BorderInfo 

  changes:

  public CellBorderStyle getLeft() -> public GraphInfo getLeft()

  public void setLeft(CellBorderStyle value) -> public void setLeft(GraphInfo value)

  public CellBorderStyle getRight() -> public GraphInfo getRight()

  public void setRight(CellBorderStyle value) -> public void setRight(GraphInfo value)

  public CellBorderStyle getTop() -> public GraphInfo getTop()

  public void setTop(CellBorderStyle value) -> public void setTop(GraphInfo value)

  public BorderInfo(int borderSide, CellBorderStyle borderStyle) -> public BorderInfo(int borderSide, GraphInfo borderStyle)

  

  added:

  public GraphInfo getBottom()

  public void setBottom(GraphInfo value)  public double getRoundedBorderRadius()

  public void setRoundedBorderRadius(double value)

  removed:

  public CellBorderStyle getBottom()

  public void setBottom(CellBorderStyle value)

  public double getRoundedBorderRadius()

  public void setRoundedBorderRadius(double value)

com.aspose.pdf.BuildVersionInfo 

renamed:

 Assembly_version -> AssemblyVersion

 File_version -> FileVersion

com.aspose.pdf.ButtonField 

added:

 public ButtonField() 

com.aspose.pdf.CellBorderStyle 

class was removed

com.aspose.pdf.CheckboxField 

added:

 public java.util.ArrayList getAllowedStates()

 public String getOnState() 

com.aspose.pdf.ComboBoxField 

added:

 public ComboBoxField()

com.aspose.pdf.Field 

added:

 public int getPageIndex()

 public static boolean getFitIntoRectangle()

 public static void setFitIntoRectangle(boolean value)

com.aspose.pdf.FitBExplicitDestination 

next constant were marked as @Deprecated:

 public FitBExplicitDestination(Document document, int pageNumber) 

 added:

 public FitBExplicitDestination(int pageNumber)

com.aspose.pdf.FitBHExplicitDestination 

next constant were marked as @Deprecated:

 public FitBHExplicitDestination(Document document, int pageNumber, double top)

added:

 public FitBHExplicitDestination(int pageNumber, double top)

com.aspose.pdf.FitBVExplicitDestination 

next constant were marked as @Deprecated:

 public FitBVExplicitDestination(Document document, int pageNumber, double left)

added:

 public FitBVExplicitDestination(int pageNumber, double left)

com.aspose.pdf.FitHExplicitDestination

next constant were marked as @Deprecated:

 public FitHExplicitDestination(Document document, int pageNumber, double top)

added:

 public FitHExplicitDestination(int pageNumber, double top)

com.aspose.pdf.FitRExplicitDestination 

next constant were marked as @Deprecated:

 public FitRExplicitDestination(Document document, int pageNumber, double left, double bottom, double right, double top)

added:

 public FitRExplicitDestination(int pageNumber, double left, double bottom, double right, double top)

com.aspose.pdf.FitVExplicitDestination 

next constant were marked as @Deprecated:

 public FitVExplicitDestination(Document document, int pageNumber, double left)

added:

 public FitVExplicitDestination(int pageNumber, double left)

com.aspose.pdf.FontRepository 

 added:
 public static FontSubstitutionCollection getSubstitutions() 
 public static FontSourceCollection getSources()
 public static Font openFont(InputStream fontStream,int fontType)
 

com.aspose.pdf.FontSource 

changes:

 public abstract FontDefinition[] getFontDefinitions() - > abstract FontDefinition[] getFontDefinitions()

com.aspose.pdf.Form 

changes:

 com.aspose.pdf.Form.getFields_Rename_Namesake() - renamed to: com.aspose.pdf.Form.getFields();

added:

  public void setType(int value)

  public void add(Field field)

  public void addFieldAppearance(Field field, int pageNumber, Rectangle rect)

com.aspose.pdf.FreeTextAnnotation 

added:

 public int getStartingStyle()

 public void setStartingStyle(int value)

 public int getEndingStyle()

 public void setEndingStyle(int value)

 public DefaultAppearance getDefaultAppearanceObject() 

com.aspose.pdf.HtmlSaveOptions 

 added inner classes:
 public static  final class HtmlImageType
 public static class HtmlImageSavingInfo
 public static class CssSavingInfo
 public static class CssUrlRequestInfo
 public interface ResourceSavingStrategy
 public interface CssUrlMakingStrategy
 public interface CssSavingStrategy

com.aspose.pdf.ImagePlacement 

added:

 public int getRotation()

 public void save(OutputStream outputStream)

 public void save(OutputStream outputStream,ImageFormat format)

com.aspose.pdf.ListBoxField 

added:

 public ListBoxField()

com.aspose.pdf.LoadOptions 

added:

 public IWarningCallback getWarningHandler()

 public void setWarningHandler

 public String ApsIntermediateFileIfAny;

 public String XpsIntermediateFileIfAny;

com.aspose.pdf.MarkupAnnotation 

added:

 public java.util.Date getCreationDate()

com.aspose.pdf.Matrix 

added:

 public IPdfArray getMatrix(ITrailerable trailer)

com.aspose.pdf.Page 

implements ISupportsMemoryCleanup

added:

 public void setBackground(Color value) 

com.aspose.pdf.PageCollection 

added:

 public int indexOf(Page entity)

com.aspose.pdf.PageLabelCollection 

changes:

 UpdateLabel  -> updateLabel

 RemoveLabel -> removeLabel

 GetPages      -> getPages

com.aspose.pdf.PageSize 

added:

 public static final float LEAVE_INTACT = -1; 

com.aspose.pdf.RichTextBoxField 

added:

 public RichTextBoxField(Page page, java.awt.Rectangle rect)  

com.aspose.pdf.SaveOptions 

added inner classes:

 public static  final class HtmlBorderLineType

 public static class BorderPartStyle

 public static class BorderInfo

 public static  final class NodeLevelResourceType

 public static class ResourceSavingInfo

added:

 public IWarningCallback getWarningHandler()

 public void setWarningHandler(IWarningCallback value) 

 public boolean getCloseResponse()

 public void setCloseResponse(boolean value) 

com.aspose.pdf.Signature 

added:

 public java.util.Date getDate()

 public void setDate(java.util.Date value)

 public Signature(InputStream pfx, String password) 

com.aspose.pdf.SignatureField 

added:

 public void sign(Signature signature,InputStream pfx, String pass)

 public void clear()

com.aspose.pdf.Stamp 

added:

 public double getZoomX()

 public void setZoomX(double value)

 public  double getWidth()

 public  void setWidth(double value)

 public  double getHeight()

 public  void setHeight(double value)

 public double getZoomY()

 public void setZoomY(double value)

com.aspose.pdf.SvgSaveOptions 

added inner classes:

 public interface EmbeddedImagesSavingStrategy

 public static  final class SvgExternalImageType

 public static class SvgImageSavingInfo 

added:

 public EmbeddedImagesSavingStrategy CustomStrategyOfEmbeddedImagesSaving 

com.aspose.pdf.TextParagraph 

added:

 public float getSubsequentLinesIndent()

 public void setSubsequentLinesIndent(float value) 

com.aspose.pdf.TextSearchOptions 

added:

 public void isRegularExpressionUsed(boolean value)

com.aspose.pdf.TextStamp 

added:

 public boolean getWordWrap()

 public void setWordWrap(boolean value)

 public boolean getJustify()

 public void setJustify(boolean value)

 public boolean getScale()

 public void setScale(boolean value)

 public  double getWidth()

 public  void setWidth(double value)

 public  double getHeight()

 public  void setHeight(double value)

com.aspose.pdf.TextState 

added:

 TextState( java.awt.Color backgroundColor, java.awt.Color foregroundColor, int fontStyle, Font font, float fontSize)

changes:

 public java.awt.Color getForegroundColor() -> public com.aspose.pdf.Color getForegroundColor() 

 public void setForegroundColor(java.awt.Color value) -> public void setForegroundColor(com.aspose.pdf.Color value)

 public java.awt.Color getBackgroundColor() -> public com.aspose.pdf.Color getBackgroundColor() 

 public void setBackgroundColor(java.awt.Color value) -> public void setBackgroundColor(com.aspose.pdf.Color value)

com.aspose.pdf.TextStyle 

next methods were marked as @Deprecated:

 public void setAlignment(int value)

 public int getAlignment() 

added:

 public void setHorizontalAlignment(int value)

 public int getHorizontalAlignment()

 public java.awt.Color getColor()

 public void setColor(java.awt.Color value)

com.aspose.pdf.XfdfReader 

added:

 public static  void readAnnotations(InputStream stream,IDocument document)

 public static  void readFields(InputStream stream,Document document)

 public static java.util.Map getElements(XmlReader reader)

changes:

 public static void readFields(Stream stream, IDocument document) -> public static void readFields(Stream stream, IDocument document, IList foundFields, IList notFoundFields)

com.aspose.pdf.XfdfTags 

added:

 public static final String CalloutLine = "callout-line";

 public static final String TextRectangle = "text-recangle";

com.aspose.pdf.XslFoLoadOptions 

added:

 public boolean isUseOldXslFoEngine() 

 public void setUseOldXslFoEngine(boolean useOldXslFoEngine) 

com.aspose.pdf.XYZExplicitDestination 

next methods were marked as @Deprecated:

 public XYZExplicitDestination(Document document, int pageNumber, double left, double top, double zoom)

added:

 public XYZExplicitDestination(int pageNumber, double left, double top, double zoom)





Aspose.Pdf for Java 9.0.0

$
0
0
We are pleased to share a new version of Aspose.Pdf for Java with following improvements.

New Features
  • PDFNEWJAVA-33751 Updating some RGB colors CMYK
  • PDFNEWNET-36394 ExportBookmarksToXML() should return output in Stream or XmlDocument object
Enhancement
  • PDFNEWJAVA-34066 Complete porting of DOM from Aspose.Pdf for .NET (New) v.9.0
  • PDFNEWJAVA-33963 Table with column more than 255 results empty PDF - aspose.pdf
Fixed bugs:
  • PDFNEWJAVA-34099 Key cannot be null exception without license implementation
  • PDFNEWJAVA-34068 Intermittent issue where random characters are shown on the licence when downloaded
  • PDFNEWJAVA-33826 Unable to concatenate PDF files
  • PDFNEWJAVA-34048 Unable to use Element.getChildren() method
  • PDFNEWJAVA-34037 PDF to Tiff conversion output has stray lines on page
  • PDFNEWJAVA-34098 Japanese text not being extracted
  • PDFNEWJAVA-34071 Text is mangled when viewing file over MAC
  • PDFNEWJAVA-34033 StackOverflowError when generating PDF document
  • PDFNEWJAVA-33686 API XML file with java code
  • PDFNEWJAVA-34062 NPE exception is being raised on filling form over Linux
  • PDFNEWJAVA-33947 PDF to JPEG - Colors appear as black in resultant Image
  • PDFNEWJAVA-33977 Sync up the javadoc and the library
  • PDFNEWJAVA-33862 XPS to PDF: some text is missing in resultant PDF file
  • PDFNEWJAVA-33606 PDF to PDFA_1b conversion issue
  • PDFNEWJAVA-33943 NullPointerException on saving PDF in Linux
  • PDFNEWJAVA-33950 Arabic text is not properly being filled inside PDF document

Public API and Backwards Incompatible Changes:

Moved:
class com.aspose.pdf.Text.FontSourceCollection to-> com.aspose.pdf.FontSourceCollection 

Added:
java.util.Map com.aspose.pdf.facades.AForm.getButtonOptionValues(String fieldName)
java.util.Map com.aspose.pdf.IForm.getButtonOptionValues(String fieldName);
void com.aspose.pdf.facades.PdfAnnotationEditor.importAnnotations(InputStream[] annotFileInputStream, int[] annotType)
void com.aspose.pdf.facades.PdfAnnotationEditor.importAnnotations(InputStream[] annotFileInputStream)
void com.aspose.pdf.facades.PdfBookmarkEditor.exportBookmarksToXML(OutputStream output)
void com.aspose.pdf.facades.PdfBookmarkEditor.importBookmarksWithXML(InputStream stream)
InputStream com.aspose.pdf.facades.PdfFileSignature.extractImage(String signName)
InputStream com.aspose.pdf.facades.PdfFileSignature.extractCertificate(String signName)
boolean com.aspose.pdf.ApsToPdfConverter.getShowFieldsBorders() { return _showFieldsBorders; }
void com.aspose.pdf.ApsToPdfConverter.setShowFieldsBorders(boolean value) { _showFieldsBorders = value; } 
String com.aspose.pdf.DocumentInfo.getTrapped()
void com.aspose.pdf.DocumentInfo.setTrapped(String value) 
float com.aspose.pdf.LevelFormat.getSubsequentLinesIndent()
void com.aspose.pdf.LevelFormat.setSubsequentLinesIndent(float value)
com.aspose.pdf.LoadFormat.MHT
com.aspose.pdf.MarkupAnnotation.MarkupAnnotation() constructor
class com.aspose.pdf.SoundSampleData
final class com.aspose.pdf.SoundSampleDataEncodingFormat 
com.aspose.pdf.TextAnnotation.TextAnnotation() constructor
com.aspose.pdf.Operator.SetRGBColorStroke.getCMYKColor(new double[3], new double[4])
com.aspose.pdf.Operator.SetRGBColor.getCMYKColor(new double[3], new double[4])
com.aspose.pdf.Operator.SetCMYKColorStroke.getRGBColor(new double[4], new double[3])
com.aspose.pdf.Operator.SetCMYKColor.getRGBColor(new double[4], new double[3])


Changed:
void  com.aspose.pdf.facades.PdfAnnotationEditor.modifyAnnotations(int start, int end, Enum annotType, Annotation annotation) to->  void  com.aspose.pdf.facades.PdfAnnotationEditor.modifyAnnotations(int start, int end, int annotType, Annotation annotation)
IList com.aspose.pdf.facades.PdfAnnotationEditor.extractAnnotations(int start, int end, String[] annotTypes) to-> com.aspose.pdf.facades.PdfAnnotationEditor.Iterable extractAnnotations(int start, int end, String[] annotTypes)
ArrayList com.aspose.pdf.facades.PdfExtractor.getAttachmentInfo() to-> Iterable com.aspose.pdf.facades.PdfExtractor.getAttachmentInfo()
void com.aspose.pdf.Field.recalculate() to-> boolean com.aspose.pdf.Field.recalculate()
boolean com.aspose.pdf.TextState.isFontSizeSet() to->boolean com.aspose.pdf.TextState.getIsFontSizeSet()
void com.aspose.pdf.TextState.isFontSizeSet(boolean value) to-> void com.aspose.pdf.TextState.setIsFontSizeSet(boolean value)
static boolean com.aspose.pdf.BidiLine.hasRTLChar(String text) to-> static boolean com.aspose.pdf.BidiLine.containsRTLChar(String text) 
com.aspose.pdf.Element.getStructureType() is internalized similar to .net version
com.aspose.pdf.Element.getgetAttributes() is internalized similar to .net version

Aspose.Pdf for Java 9.1.0

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements.

New Features
  • PDFNEWJAVA-33314 PDF Bookmark should point to the start of page
  • PDFNEWJAVA-33310 Save the resultant PDF in particular PDF file version
  • PDFNEWJAVA-33553 Retrieve all Signatures and Images from PDF
  • PDFNEWJAVA-34070 Force table rendering in new page
Enhancement
  • PDFNEWJAVA-34059 Performance of the document.save method
Fixed bugs:
  • PDFNEWJAVA-34063 Concatenating Tagged file results into non-tagged file.
  • PDFNEWJAVA-34063 Concatenating Tagged file results into non-tagged file.
  • PDFNEWJAVA-33952 Aspose.Pdf for Java throws stackoverflow exception if default Locale is other than English
  • PDFNEWJAVA-34024 Exception while removing image from PDF file
  • PDFNEWJAVA-33902 Unable to add digital signature to PDF file
  • PDFNEWJAVA-34179 PDF to JPEG - Image Resolution is always 96
  • PDFNEWJAVA-33494 Black pixels appear when adding an antialiased transparent image to a pdf
  • PDFNEWJAVA-34052 Aspose.Pdf attempting to open images in RW rather than RO

Investigations (Not a Bug):

  • PDFNEWJAVA-33557 Compare two PDF files

Public API and Backwards Incompatible Changes:

Added the following classes:
BaseOperatorCollection
DocMDPAccessPermissions
DocMDPSignature
LightweightOperatorCollection
OcspSettings
PclConverter
PclSaveOptions
TextParagraphAbsorber
TextParagraphCollection
TimestampSettings
UnifiedSaveOptions

Changed class names:
MhtToPdfConverter -> MhtConverter
XpsToPdfConverter -> XpsConverter

In class SaveFormat was renamed field:
SaveFormat.None -> SaveFormat.Pdf
In class XForm was renamed method :
public Rectangle getRectangle_Rename_Namesake () -> public Rectangle getRectangle()
In PdfFileEditor class was added the next methods:
public boolean getCopyLogicalStructure()
public void setCopyLogicalStructure(boolean value)
In PdfFileSignature class was added the next methods:
public boolean isCertified()
public int getAccessPermissions()
public void certify(int page, String SigReason, String SigContact, String SigLocation, boolean visible, java.awt.Rectangle annotRect, DocMDPSignature docMdpSignature)
In Stamp class was added the next methods:
public int getQuality()
public void setQuality(int value)
In Document class was added the next methods:
public Copier getDefaultCopier()
public Object getCatalogValue(String key)
In Annotation class was added the next methods:
public static boolean getUseFontSubset()
public static void setUseFontSubset(boolean value)
public void setColor_Rename_Namesake(Color value)
In BaseParagraph class was added the next methods:
public boolean isInNewPage()
public void isInNewPage(boolean value)
In DocSaveOptions class changes:
DocSaveOptions extends SaveOptions -> DocSaveOptions extends UnifiedSaveOptions
added field:
public ConversionProgressEventHandler CustomProgressHandler
In HtmlConverter class was renamed method name:
saveReferencedHtml (..)->saveOneHtmlPageMarkup (..)
In HtmlSaveOptions class changes:
HtmlSaveOptions extends SaveOptions -> HtmlSaveOptions extends UnifiedSaveOptions
added field:
public ConversionProgressEventHandler CustomProgressHandler
added internal classes:
public static class HtmlPageMarkupSavingInfo
public static final class HtmlMarkupGenerationModes
In ImageStamp class was added the next methods:
public int getQuality()
public void setQuality(int value)
In MobiXmlSaveOptions class changes:
MobiXmlSaveOptions extends SaveOptions -> MobiXmlSaveOptions extends UnifiedSaveOptions
In OperatorCollection class changes:
public final class OperatorCollection implements ICollection -> public class OperatorCollection extends BaseOperatorCollection implements ICollection
In PdfFormat class was added the next element:
public static final int PDF_X_3 = 10;
In Signature class added the next methods:
public TimestampSettings getTimestampSettings()
public void setTimestampSettings(TimestampSettings value)
In TextBuilder class changes:
public TextBuilder(Page page, OperatorCollection operatorCollection) -> public TextBuilder(Page page, BaseOperatorCollection operatorCollection)
In Watermark class changes:
public Watermark(com.aspose.ms.System.Drawing.Image image) -> public Watermark(BufferedImage nativeImage)
added constructor:
public Watermark(BufferedImage nativeImage, Rectangle rect)
added method:
public BufferedImage getImage()
In XImageCollection class changes:
added method:
public void add(InputStream image, int quality)
In XpsSaveOptions class changes:
XpsSaveOptions extends SaveOptions -> XpsSaveOptions extends UnifiedSaveOptions

Aspose.Pdf for Java 9.3.0

$
0
0
We are pleased to share a new version of Aspose.Pdf for Java with following improvements.

New Features

PDFNEWJAVA-33499 Convert PDF file to PDF/A3
PDFNEWJAVA-33174 PDF Expiration Feature
PDFNEWJAVA-34208 Pdf to Excel converter

Enhancements

PDFNEWJAVA-34254 BindFO() method with ByteArrayInputStream parameter
PDFNEWJAVA-34302 MemoryLeaks during text extraction

Bugs

PDFNEWJAVA-34303 StackOverflowError on getting RadioButton
PDFNEWJAVA-33695 PCL to PDF: java.lang.RuntimeException
PDFNEWJAVA-33861 XPS to PDF: Rectangle renders incorrectly
PDFNEWJAVA-34014 HTML to PDF conversion throws ClassNotFoundException
PDFNEWJAVA-34087 SVG to PDF - Input SVG file isn't closed
PDFNEWJAVA-34061 XPS to PDF - Bookmarks not being honored 
PDFNEWJAVA-34300 Some methods and fields are not visible after obfuscation
PDFNEWJAVA-34204 ZipException: unknown compression method while openning PNG-file
PDFNEWJAVA-33972 XPS to PDF conversion: Invalid character found exception in com.aspose.ms.System.Xml.hr class
PDFNEWJAVA-34047 HTML to PDF throws RuntimeException: Class com.aspose.css.model.properties.TextDecorationLineProperty cannot be found
PDFNEWJAVA-34309 Image extraction code compilation error "ag cannot be resolved to a type"
PDFNEWJAVA-34063 Concatenating Tagged file results into non-tagged file.
PDFNEWJAVA-33813 PDF to PNG: JAR throwing Corrupt content Exception message
PDFNEWJAVA-34118 NullPointerException in getFieldFacade
PDFNEWJAVA-34189 PDF to PNG - Text dropping out in the images
PDFNEWJAVA-34195 PDF to Image - Java heap space error while conversion
PDFNEWJAVA-34242 API does not listing all XFA fields
PDFNEWJAVA-34243 Bookmarks collection only retains last bookmark
PDFNEWJAVA-34261 Invalid parameters appearing against getNextImage method
PDFNEWJAVA-34269 PDF to Image conversion is not working in 9.1.0
PDFNEWJAVA-34281 NullReference exception when trying to read form field names

Investigations (Not a Bug):

PDFNEWJAVA-33929 PDF to DOC: Basic paragraph handling


Public API and Backwards Incompatible Changes

FO to PDF conversion issue
            XslFoLoadOptions options = new XslFoLoadOptions();
            options.UseOldXslFoEngine=false;

            Document pdfDocument = new Document("inFo.fo", options);
            pdfDocument.Save("outPdf.pdf");

Support of PDF/A-3B
        Document doc = new Document("inFile.pdf");
        doc.convert("logFile.txt", PdfFormat.PDF_A_3B, ConvertErrorAction.Delete);
        doc.save("outFile.pdf");

Use DocumentPrivilege to set encryption in DOM Encryption
        Document document = new Document("inputFile.pdf");
        try /*JAVA: was using*/
        {            
            DocumentPrivilege documentPrivilege = DocumentPrivilege.getForbidAll();
            documentPrivilege.setAllowScreenReaders(true);
            documentPrivilege.setAllowPrint(true);                                

            document.encrypt("user", "owner", documentPrivilege, CryptoAlgorithm.AESx128, false);
            document.save("outputFile.pdf");
        }
        finally { if (document != null) document.dispose(); }     


Classes from package com.aspose.pdf.generator.legacyxmlmodel.enums was moved to com.aspose.pdf.generator.legacyxmlmodel

Added classes:
com.aspose.pdf.MemoryCleaner
com.aspose.pdf.generator.legacy.CmykColorSpace
com.aspose.pdf.generator.legacy.GrayColorSpace
com.aspose.pdf.generator.legacyxmlmodel.ClippingPath
com.aspose.pdf.generator.legacyxmlmodel.ColouredTilingPattern
com.aspose.pdf.generator.legacyxmlmodel.CompareValidator
com.aspose.pdf.generator.legacyxmlmodel.CrossHatchPattern
com.aspose.pdf.generator.legacyxmlmodel.CustomValidator
com.aspose.pdf.generator.legacyxmlmodel.Function
com.aspose.pdf.generator.legacyxmlmodel.FunctionExpInterpolation
com.aspose.pdf.generator.legacyxmlmodel.GradientAxialShading
com.aspose.pdf.generator.legacyxmlmodel.GradientRadialShading
com.aspose.pdf.generator.legacyxmlmodel.HatchingPattern
com.aspose.pdf.generator.legacyxmlmodel.ImagePattern
com.aspose.pdf.generator.legacyxmlmodel.PointsPattern
com.aspose.pdf.generator.legacyxmlmodel.RangeValidator
com.aspose.pdf.generator.legacyxmlmodel.RegularExpressionValidator
com.aspose.pdf.generator.legacyxmlmodel.RequiredFieldValidator
com.aspose.pdf.generator.legacyxmlmodel.ShadingGradientPattern
com.aspose.pdf.generator.legacyxmlmodel.ShadingPattern
com.aspose.pdf.generator.legacyxmlmodel.ShadingPatternFactory
com.aspose.pdf.generator.legacyxmlmodel.TilingPattern
com.aspose.pdf.generator.legacyxmlmodel.UncolouredTilingPattern
com.aspose.pdf.Artifact.ArtifactType
com.aspose.pdf.Artifact.ArtifactSubtype
com.aspose.pdf.ILicenseProvider
com.aspose.pdf.Layer
com.aspose.pdf.LettersPositioningMethods

Added enumeration  classes:
com.aspose.pdf.generator.legacyxmlmodel.enums.FunctionType
com.aspose.pdf.generator.legacyxmlmodel.enums.PaintType
com.aspose.pdf.generator.legacyxmlmodel.enums.PatternType
com.aspose.pdf.generator.legacyxmlmodel.enums.ShadingGradientType
com.aspose.pdf.generator.legacyxmlmodel.enums.TilingType

Removed classes:
Depricated  com.aspose.pdf.generator.legacyxmlmodel.enums.TextAlignmentType class was removed.

Implemented usage of enumeration classes: TextEncodingInternal and ImageFormatInternal 

Internalized classes:
com.aspose.pdf.XfdfTags
com.aspose.pdf.generator.legacyxmlmodel.NonClosedShape 
com.aspose.pdf.generator.legacyxmlmodel.ComplexShape
com.aspose.pdf.generator.legacyxmlmodel.Circle
com.aspose.pdf.generator.legacyxmlmodel.Curve
com.aspose.pdf.generator.legacyxmlmodel.NonClosedShape
com.aspose.pdf.generator.legacyxmlmodel.Ellipse
com.aspose.pdf.generator.legacyxmlmodel.PolyDashArray
com.aspose.pdf.generator.legacyxmlmodel.PathArea
com.aspose.pdf.generator.legacyxmlmodel.Rectangle

Changes to classes:
In XImage class was added method 
 public BufferedImage getGrayscaled()
In PdfExtractor class was added method 
 public extractText(java.nio.charset.Charset value) 
In PdfFileEditor class was added method 
 public static void validateAnotations(IDocument doc)
In BorderInfo class added new constructors:
 public BorderInfo(int borderSide)
 public BorderInfo(int borderSide, GraphInfo borderFormat)
 public BorderInfo(int borderSide, float borderWidth)
 public BorderInfo(int borderSide, float borderWidth, Color borderColor)
 public BorderInfo(int borderSide, Color borderColor)
In Canvas class added method 
 public Object deepClone()
In Cell class added methods:
 public boolean isNoBorder()
 public void setNoBorder(boolean value)
 public Object completeClone()
In DocumentAttachment class added method 
 public Object completeClone()
In FloatingBox class added method
 public Object completeClone()
In FormField class added method
 public Object completeClone()
In Graph class added methods:
 public float getRotatingAngle() 
 public void setRotatingAngle(float value) 
 public ClippingPath getClipping() 
 public void setClipping(ClippingPath value) 
 public Object completeClone()
In Image class added constructors and methods:
 public Image()
 public Image(Section section)
 public int getAutoNumber()
 public void setAutoNumber(int value)
 public float getImageHeight() 
 public void setImageHeight(float value) 
 public float getImageWidth() 
 public void setImageWidth(float value) 
 public float getVectorGraphicsRenderingDPI() 
 public void setVectorGraphicsRenderingDPI(float value)
 public float getImageScale() 
 public void setImageScale(float value)
 public Object completeClone()           
In ImageInfo class added fields and methods:
 public TextInfo TextInfo
 public String Title
 public BorderInfo ImageBorder
 public /*ImageFileType*/int _ImageFileType
 public InputStream getImageStream()
 public void setImageStream(InputStream value)
 public BufferedImage getSystemImage()
 public void setSystemImage(BufferedImage value)  
 public /*Byte*/byte[] getMemoryData() 
 public void setMemoryData(/*Byte*/byte[] value) 
 public boolean isFixImgWidthSettedInXML() 
 public void setFixImgWidthSettedInXML(boolean value) 
 public boolean isFixImgHeightSettedInXML()
 public void setFixImgHeightSettedInXML(boolean value) 
 public boolean isAllFramesInNewPage() 
 public void setAllFramesInNewPage(boolean value)
 public boolean isStencilMask() 
 public void setStencilMask(boolean value)
 public com.aspose.pdf.generator.legacyxmlmodel.Color getBackgroundColor() 
 public void setBackgroundColor(com.aspose.pdf.generator.legacyxmlmodel.Color value)
 public java.awt.Color getPatternColor()
 public void setPatternColor(java.awt.Color value) 
In Paragraph class added fields and methods:
 public float FixedHeight;
 public float FixedWidth;
 public /*BookmarkIncludeType*/int getBookmarked()
 public void setBookmarked(/*BookmarkIncludeType*/int value)
 public void copyTo(Paragraph par)
In RadioButton class added method
 public Object completeClone()
In Row class added method
 public Object completeClone()
In Segment class added method
 public Object completeClone()
In Shape class added method
 public float getOpacity()
 public void setOpacity(float value)
 public float getStrokeOpacity() 
 public void setStrokeOpacity(float value)  
In Shapes class some methods were internalized:
 void add(Shape shape)
 void remove(Shape shapeToRemove)
 void copyTo(Shape[] shapeArray, int index)
 int indexOf(Shape shape)
In Table class added method
 public /*override*/ Object completeClone()
In Text class added method
 public /*override*/ Object completeClone()
In XslFoLoadOptions class added method
 public String getBasePath() 
 public void setBasePath(String value) 
In PdfBookmarkEditor class added method
 public Bookmarks extractBookmarks(boolean upperLevel)


All the boolean setter method names that were started from is* was renamed ro set*
for example:
 com.aspose.pdf.facades.ReplaceTextStrategy.isRegularExpressionUsed(boolean value) -> com.aspose.pdf.facades.ReplaceTextStrategy.setRegularExpressionUsed(boolean value)


UnembedFonts property was introduced to OptimizationOptions class.

If the property is set to true - the fonts become not embedded.

Document doc = new Document("input.htm");
Document.OptimizationOptions opt = new Document.OptimizationOptions();
opt.setUnembedFonts ( true );
doc.optimizeResources(opt);
doc.save("output.pdf");

CompressImages and ImageQuality properties were introduced to OptimizationOptions class.

If CompressImages set to true all images in the document will be recompressed and compression is defined by ImageQuality property which is value of quality in percent. 100% is unchanged quality and image size. To decrease image size use ImageQuality < 100. 

Document doc = new  Document("input.htm");
Document.OptimizationOptions opt = new Document.OptimizationOptions();
opt.setRemoveUnusedObjects ( false );
opt.setLinkDuplcateStreams ( false );
opt.setRemoveUnusedStreams ( false );
opt.setCompressImages ( true );
opt.setImageQuality ( 10 );
doc.optimizeResources(opt);
doc.save("output.pdf");

InputEncoding option was introduced into HtmlLoadOptions class

The InputEncoding may be set to explicitly set the encoding of the document.

HtmlLoadOptions options = new HtmlLoadOptions();
options.setInputEncoding ( "windows-1252" );
Document doc = new Document("input.htm", options);
doc.save("output.pdf");

Option LettersPositioningMethod has been introduced into HtmlSaveOptions.

Enumeration LettersPositioningMethods was introduced into Aspose.Pdf namespace.
the enumeration provides following values:

    UseEmUnitsAndCompensationOfRoundingErrorsInCss
    It's default method. It uses EM-units and special alhorithm of compensation of rounding errors
    It's preferable for usage in IE10.0 and more fresh versions and gives better scaling of captions when scaling is necessary
    UsePixelUnitsInCssLetterSpacingForIE
    It allows to get sometimes more precise results in old IE browser versions

Following code snippet demonstrates how to optimize letter positioning in old IE browsers:

Document pdfDocument = new Document("input.pdf");
HtmlSaveOptions saveOptions = new HtmlSaveOptions(HtmlDocumentType.Xhtml);
// checked setting
saveOptions.LettersPositioningMethod = LettersPositioningMethods.UsePixelUnitsInCssLetterSpacingForIE;
pdfDocument.save("output.html", saveOptions );


Cross, Circle ,Star values were added into com.aspose.pdf.TextIcon enumeration:

Cross - Cross icon.
Circle - Circle icon.
Star - Star icon.

The code demonstrates how to use new icons in TextAnnotation:

TextAnnotation ta = new TextAnnotation(page, new Rectangle(100, y - size, 100 + size, y));
ta.setIcon ( TextIcon.Star );
page.getAnnotations().add(ta);


Layer class was introduced

The Layer class contains following properties:
Name - Layer Name
Id - layer Id
Contents - layer operators list

Layers collection was added to Page class

Following code snippet demonstrates how to add layers to Pdf document:

        Document doc = new Document();
        Page page = doc.getPages().add();
        Layer layer = new Layer("oc1", "Red Line");
        layer.getContents().add(new Operator.SetRGBColorStroke(1, 0, 0));
        layer.getContents().add(new Operator.MoveTo(500, 700));
        layer.getContents().add(new Operator.LineTo(400, 700));
        layer.getContents().add(new Operator.Stroke());
        page.setLayers( new ArrayList());
        page.getLayers().add(layer);
        layer = new Layer("oc2", "Green Line");
        layer.getContents().add(new Operator.SetRGBColorStroke(0, 1, 0));
        layer.getContents().add(new Operator.MoveTo(500, 750));
        layer.getContents().add(new Operator.LineTo(400, 750));
        layer.getContents().add(new Operator.Stroke());
        page.getLayers().add(layer);
        layer = new Layer("oc3", "Blue Line");
        layer.getContents().add(new Operator.SetRGBColorStroke(0, 0, 1));
        layer.getContents().add(new Operator.MoveTo(500, 800));
        layer.getContents().add(new Operator.LineTo(400, 800));
        layer.getContents().add(new Operator.Stroke());
        page.getLayers().add(layer);
        doc.save("output.pdf");

PDFNEWJAVA-33174 PDF Expiration Feature

JavaScript feature is implemented. So, the customer can use it to implement needed feature.

Example:

Document doc = new Document("d:\\input.pdf");
    JavascriptAction javaScript=new JavascriptAction(
    "var year=2014;"
    + "var month=4;"
    + "today = new Date(); today = new Date(today.getFullYear(), today.getMonth());"
    + "expiry = new Date(year, month);"
    + "if (today.getTime() > expiry.getTime())"
    + "app.alert('The file is expired. You need a new one.');");
    doc.setOpenAction(javaScript);
    doc.save("d:\\JavaScript-Added.pdf");

PDFNEWJAVA-34208 Pdf to Excel converter

Implemented support for converting PDF to Excel

Example:

Document doc = new Document("c:/pdftest/test.pdf");
doc.save("c:/pdftest/test_output.xls", SaveFormat.Excel);

PDFNEWJAVA-34302 MemoryLeaks during text extraction

If the heap memory is limited, needs to use cleaning aspose caches after aspose.pdf tasks.
com.aspose.pdf.MemoryCleaner.clear();

Aspose.Pdf for Java 9.3.1

$
0
0
We are pleased to announce the release of latest hotfix containing resolution of some high priority issues.

Enhancements:
PDFNEWJAVA-33916 Improve PDF to Image conversion performance
PDFNEWJAVA-34065 HTML to PDF - Add a setting to not pull down remote resources
PDFNEWJAVA-33406 Enhance support for JavaScript in PDF documents
PDFNEWJAVA-34337 Memory leak issue.Bugs:
PDFNEWJAVA-34218 PDF to PNG - Incomplete number line in converted image
PDFNEWJAVA-34217 PDF to PNG - Pages are not properly being rendered
PDFNEWJAVA-34216 PDF to PNG - Resultant images don't have background color and have inverted colors
PDFNEWJAVA-34310 PDF to PNG - resultant images are not correct
PDFNEWJAVA-34311 PDF to PNG - OutOfMemoryError during conversion
PDFNEWJAVA-34198 PDF to PNG - Images are not properly rendered
PDFNEWJAVA-34176 PDF to PNG - Circles display incorrect in image file
PDFNEWJAVA-34229 Incorrect drawing lines if the resolution is 300
PDFNEWJAVA-33568 Removing single bookmark causes invalid signatures on pdf
PDFNEWJAVA-34063 Concatenating Tagged file results into non-tagged file.
PDFNEWJAVA-33935 PDF to DOC: Underline is not being rendered properly
PDFNEWJAVA-33931 PDF to DOC: Extra space in list items
PDFNEWJAVA-34318 StackOverflowError on using RegularExpressionValidator in FormField
PDFNEWJAVA-34330 PDF to HTML: generation of three font set issue
PDFNEWJAVA-34334 PDF to HTML: Images are not being exported
PDFNEWJAVA-34183 PDF to HTML - images are not properly being exported
PDFNEWJAVA-34293 PDF to HTML - Images are not appearing in resultant HTML
PDFNEWJAVA-33568 Removing single bookmark causes invalid signatures on pdf
PDFNEWJAVA-34229 Incorrect drawing lines if the resolution is 300
PDFNEWJAVA-34331 PDF to Image: underline text renders incorrectly.Investigation (not a Bug) 
PDFNEWJAVA-34265 Child bookmarks are not being added correctlyPublic API and Backwards Incompatible ChangesThe following methods have been internalized:
com.aspose.pdf.DocumentInfo.setCreator(String)
com.aspose.pdf.DocumentInfo.setProducer(String)
com.aspose.pdf.FileParams.getEngineDict()The following depricated constants have been internalized, need to use static getters instead:
com.aspose.pdf.ImageFormatInternal.Bmp
com.aspose.pdf.ImageFormatInternal.Emf
com.aspose.pdf.ImageFormatInternal.Exif
com.aspose.pdf.ImageFormatInternal.Gif
com.aspose.pdf.ImageFormatInternal.Jpeg
com.aspose.pdf.ImageFormatInternal.Icon
com.aspose.pdf.ImageFormatInternal.MemoryBmp
com.aspose.pdf.ImageFormatInternal.Png
com.aspose.pdf.ImageFormatInternal.Tiff
com.aspose.pdf.ImageFormatInternal.Wmf
com.aspose.pdf.TextEncodingInternal.ASCII
com.aspose.pdf.TextEncodingInternal.BigEndianUnicode
com.aspose.pdf.TextEncodingInternal.Default
com.aspose.pdf.TextEncodingInternal.Unicode
com.aspose.pdf.TextEncodingInternal.UTF32
com.aspose.pdf.TextEncodingInternal.UTF32BE
com.aspose.pdf.TextEncodingInternal.UTF7
com.aspose.pdf.TextEncodingInternal.UTF8
com.aspose.pdf.TextEncodingInternal.UTF8UnmarkedThe following field was added:
public static Rectangle com.aspose.pdf.Rectangle.getEmpty() - returns Empty rectanglePDFNEWJAVA-33406 Enhance support for JavaScript in PDF documentsImplemented support for JavaScript in PDF file.

-code for document Level 
Document.setOpenAction(JavascriptAction)
-code for Page Level 
document.getPages().get_Item(2).getActions().setOnOpen(JavascriptAction)
document.getPages().get_Item(2).getActions().setOnClose(JavascriptAction)


Code Snippet for DOM, examples to insert JavaScript into different place:

String path = "D:\\";
		String fileOut = path+ "JavaScript.pdf";
	        IDocument document = null;
	        try 
	        {
	            document = new Document();
	            document.getPages().add();
	            document.getPages().add();
	            
//Adding JavaScript at Document Level
//Instantiate JavascriptAction with desried JavaScript statement
	          JavascriptAction javaScript=new JavascriptAction("this.print({bUI:true,bSilent:false,bShrinkToFit:true});");

//Assigne JavascriptAction object to desired action of Document
	          document.setOpenAction(javaScript);
	          document.setOpenAction(new JavascriptAction("app.alert('Hello PDF')"));
	          
//Adding JavaScript at Page Level
	          document.getActions().setBeforeClosing(new JavascriptAction("app.alert('document is closing')"));
	          
	          document.getPages().get_Item(1).getActions().setOnOpen(new JavascriptAction("app.alert('page 1 is opened')"));	          
	          document.getPages().get_Item(2).getActions().setOnOpen(new JavascriptAction("app.alert('page 2 is opened')"));
	          document.getPages().get_Item(2).getActions().setOnClose(new JavascriptAction("app.alert('page 2 is closed')"));
	          
//after printing
	          document.getActions().setAfterPrinting(new JavascriptAction("app.alert('File was printed')"));
//after saving
	          document.getActions().setAfterSaving(new JavascriptAction("app.alert('File was Saved')"));
	            document.save(fileOut);
	        }
	        finally { if (document != null) document.dispose(); document = null;}

Code Snippet for old generator:

String path = "D:\\";
		//Instantiate a PDF Object
		Pdf pdf = new Pdf();
		pdf.setJavaScripts(new JavaScripts());

		//Call the Add method and JavaScript statement as an argument, to show alert
		pdf.getJavaScripts().add("app.alert(\"hello world\");");

		FileOutputStream out = new FileOutputStream(new File(path+"test.pdf"));

		//Save Pdf Document
		pdf.save(out);

Example to add formating code and value validation:

		initLicense();
		String path = "D:\\Temp\\";	
		Document doc = new Document(path+"PdfWithAcroForm.pdf");
		TextBoxField text = (TextBoxField)doc.getForm().get_Item("textField");
		text.getActions().setOnFormat (new JavascriptAction("AFNumber_Format(2, 0, 0, \"\", true);"));
		text.getActions().setOnModifyCharacter ( new JavascriptAction("AFNumber_Keystroke(2, 0, 0, \"\", true);"));
		text.getActions().setOnValidate ( new JavascriptAction("AFRange_Validate(true, 1, true, 100);"));
		text.setValue  ("100");
		doc.save(path+"formatted.pdf");

PDFNEWJAVA-34337 Memory leak issue

If the client has completed the work with our library and wants to clear the memory from different static instances,
to make free the maximum memory for other processes, the following line should be executed: 
com.aspose.pdf.MemoryCleaner.clear ();PDFNEWJAVA-34065 HTML to PDF - Add a setting to not pull down remote resources Realizing ResurseLoadingStrategi object at its discretion can perform different actions with remote resources. For example, to ignore the resources specific addresses: String inHtml = "D:\\Temp\\simple.html"; String outPdf = "D:\\Temp\\output.pdf"; HtmlLoadOptions options = new HtmlLoadOptions(); options.setUseNewConversionEngine (true); options.CustomLoaderOfExternalResources = new ResourceLoadingStrategy() { public ResourceLoadingResult invoke(String resourceURI) { //Creating clear template resource for replacing: LoadOptions.ResourceLoadingResult res = new LoadOptions.ResourceLoadingResult(new byte[] {}); // return empty byte array in case i.imgur.com server if (resourceURI.contains("i.imgur.com")) { return res; } else { // process resources with default resource loader res.LoadingCancelled = true; return res; } } }; // Do conversion Document pdfDocument = new Document(inHtml, options); pdfDocument.save(outPdf);

Aspose.Pdf for Java 9.5.0

$
0
0
We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Features:
PDFNEWJAVA-33234 Create TrueTypeFontHeader for converted bitmap fonts (0,1,2-bound)
PDFNEWJAVA-33203 Setting DPI/PPI of images in PDF
PDFNEWJAVA-33311 add digital signatues while creating PDF document
PDFNEWJAVA-34088 PDF to HTML conversion: To specify image folder
PDFNEWJAVA-33258 Support HP-GL to PDF conversion
PDFNEWJAVA-33138 FDF file conversion to/from PDF
PDFNEWJAVA-33313 Remove MetaData information from PDF file
Enhancements:
PDFNEWJAVA-33498 Provide support to add Image from BufferedImage into PDF document
PDFNEWJAVA-33945 System default font should be used in case of missing fonts
Fixed Bugs:
PDFNEWJAVA-34219 PDF to PNG - Crop marks appearing and objects missing in image
PDFNEWJAVA-34322 Image to PDF: memory consumption with large images
PDFNEWJAVA-34270 XPS to PDF - Charts are not appearing in resultant PDF
PDFNEWJAVA-34422 Type1ParsingException: Unexpected font parsing exception
PDFNEWJAVA-33583 Review and fix errors in ported pdf-generator by regression tests
PDFNEWJAVA-33453 When adding attachment to PDF file, the name and contents of attachment get corrupted
PDFNEWJAVA-33472 NotImplementedException is thrown while converting PDF to HTML format
PDFNEWJAVA-33477 Issue in adding image in existing PDF document
PDFNEWJAVA-34313 PDF to Image: resultant image is incorrect
PDFNEWJAVA-34348 PDF to JPEG - ArrayIndexOutOfBoundsException is being generated
PDFNEWJAVA-34166 PDF to DOC: split words issue
PDFNEWJAVA-33933 PDF to DOC: Random character insertion in Heading
PDFNEWJAVA-34323 XPS to PDF: images are rendered incorrectly
PDFNEWJAVA-34377 Jar is throwing Exception while retrieving pdf Signature Information
PDFNEWJAVA-33589 Unable to add digital signature to PDF file
PDFNEWJAVA-34319 PageHeight limiation issue
PDFNEWJAVA-34233 An exception is being generated when retrieving annotations from PDF
PDFNEWJAVA-34320 optimize() method corrupts the Bookmark contents
PDFNEWJAVA-34151 PDF to PNG - Column background is appearing as black
PDFNEWJAVA-34360 TOC expanding to second page throwsNullPointerException
PDFNEWJAVA-34307 PDF to text: extraction of duplicate characters
PDFNEWJAVA-33783 Incorrect text is being extracted from PDF
PDFNEWJAVA-34301 Text replace issue in evaluation mode
PDFNEWJAVA-33944 All text after modified text are broken
PDFNEWJAVA-34205 Bookmark disappears after specifing ViewerPreference
PDFNEWJAVA-34076 SVG to PDF - contents are chopped
PDFNEWJAVA-34077 SVG to PDF - Contents moving outside right margin


Investigation (not a Bug) 
PDFNEWJAVA-34170 PDF to HTML - Set Prefix for URLs of SVG Files
PDFNEWJAVA-34387 Issue in finding and highlighting a phrase broken into two lines
PDFNEWJAVA-33643 Exception on PDF to PCL conversion when font not found
PDFNEWJAVA-33905 PDF to XML conversion support
Public API and Backwards Incompatible Changes
Property CoordinateType was added to PdfViewer and PdfConverter

The CoordinateType property allows to set printable area to MediaBox or CropBox (default value)

SetFieldImage method was added to XFA class: 

public void SetFieldImage(string fieldName, Stream image)

Example:

Following code snippet shows how to set image for XFA form field:

Document doc = new Document("doc.pdf");
InputStream fs = new FileInputStream("image.jpg");
doc.getForm().getXFA().setFieldImage("form1[0].ImageField1[0]", fs);
doc.save("37017-1.pdf");

ReplaceAdjustment enumeration was added into TextReplaceOptions class
the enum provides following values:
None - No action, length of the line may be changed
AdjustSpaceWidth - Try to adjust spaces between words to keep line length
ReplaceAdjustmentAction property was added into TextReplaceOptions class

TextReplaceOptions class has new constructor that allows to set ReplaceAdjustment parameter:

TextReplaceOptions(int adjustment, int scope)

TextReplaceOptions property was added into TextFragmentAbsorber class

Ellipse class was implemented:

Constructor:
public Ellipse(float left, float bottom, float width, float height)

Properties:
 Left - float value that indicates the left position of the ellipse.
 Bottom - float value that indicates the bottom position of the ellipse.
 Width - float value that indicates the width of the ellipse.
 Height - float value that indicates the height of the ellipse.

Example:
Following code snippet shows how to add Ellipse: 

    String outFile = "Ellipse.pdf";
    Document doc = new Document();
    Page page = doc.getPages().add();
    Graph canvas = new Graph(400, 100);
    page.getParagraphs().add(canvas);
    Ellipse ellipse1 = new Ellipse(50, 10, 100, 50);
    canvas.getShapes().add(ellipse1);
    doc.save(outFile);

Path class was implemented

Constructors:
public Path()
 public Path(Shape[] shapes)

Property:
 Shapes - shapes collection

Example:
following code snippet shows how o add Path: 

Document doc = new Document();
Page page = doc.getPages().add();
Graph graph = new Graph(100, 400);
page.getParagraphs().add(graph);

Path path = new Path();
path.getGraphInfo().setFillColor ( Color.getRed());
graph.getShapes().add(path);

Line line = new Line(new float[] { 200, 80, 200, 100 });
path.getShapes().add(line);
Arc arc = new Arc(200, 50, 50, 90, 270);
path.getShapes().add(arc);
float[] curPos = arc.getEndPosition();
line = new Line(new float[] { curPos[0], curPos[1], 200, 20 });
path.getShapes().add(line);
arc = new Arc(200, 50, 30, 270, 90);
path.getShapes().add(arc);
doc.Save(outFile);


HtmlFragment class was added into package com.aspose.pdf


Constructor:
public HtmlFragment(string text)

Parameter:
text - HTML text
Property:
Text - HTML text

Example:

Following code snippet shows how to add HTML fragment:

    Document doc = new Document();
    Page page = doc.getPages().add();
    HtmlFragment titel = new HtmlFragment("<fontsize=10><b><i>Table</i></b></fontsize>");
    titel.setKeptWithNext (true);
    titel.getMargin().setBottom (10);
    titel.getMargin().setTop (200);
    page.getParagraphs().add(titel);
    doc.Save(outFile);

ContainsUsageRights() method was added into PdfFileSignature class

RemoveUsageRights() method was added into PdfFileSignature class
Example:
Following code shows ho to remove usage rights feature from the document:

PdfFileSignature pdfSign = new PdfFileSignature();
try{
   String inputFile = "c:\\36908.pdf";
   String outputFile = "c:\\36908_output.pdf";

   pdfSign.bindPdf(inputFile);
   if (pdfSign.containsUsageRights())
   {
        pdfSign.removeUsageRights();
   }

   pdfSign.getDocument().save(outputFile);
}finally
{
    pdfSign.dispose();
}

 
isContainSignature() method was renamed into ContainsSignature

Previous method name was not removed but marked as obsolete to be removed in future.

isCoversWholeDocument() method was renamed into CoversWholeDocument

Previous method name was not removed but marked as obsolete to be removed in future.


Measure class was added into com.aspose.pdf package

The Class describes Measure coordinate system.
members of Measure class:

Constructor:
public Measure(Annotation annotation)
get/set Properties:

    ScaleRatio - A text string expressing the scale ratio of the drawing.
    XFormat - A number format array for measurement of change along the xaxis and, if Y is not present, along the y axis as well
    YFormat - A number format array for measurement of change along the y axis.
    DistanceFormat - A number format array for measurement of distance in any direction.
    AreaFormat - A number format array for measurement of area.
    AngleFormat - A number format array for measurement of angles.
    SlopeFormat - A number format array for measurement of the slope of a line.
    Origin - Point that shall specify the origin of the measurement coordinate system in default user space coordinates.
    XYFactor - A factor that shall be used to convert the largest units along the y axis to the largest units along the x axis.

NumberFormat class was added into Measure class


the class represents Number format for measure.
Constructor:

public NumberFormat(Measure measure)
get/set Properties

    UnitLabel - A text string specifying a label for displaying the units.
    ConvresionFactor - The conversion factor used to multiply a value in partial units of the previous number format array element to obtain a value in the units of this number format.
    FractionDisplayment - In what manner fractional values are displayed.
    Precision - If FractionDisplayment is ShowAsDecimal, this value is precision of fractional value; It shall me multiple of 10. Default is 100.
    Denominator - If FractionDisplayment is ShowAsFraction, this value is denominator of the fraction. Default value is 16.
    ForceDenominator - If FractionDisplayment is ShowAsFraction, this value determines meay or not the fraction be reduced. If value is true fraction may not be reduced.
    ThousandsSeparator - Text that shall be used between orders of thousands in display of numerical values. An empty string indicates that no text shall be added. Default is comma.
    FractionSeparator - Text that shall be used as the decimal position in displaying numerical values. An empty string indicates that the default shall be used. Default is period character.
    BeforeText - Text that shall be concatenated to the left of the label.
    AfterText - Text that shall be concatenated after the label

Enumeration FractionStyle was added into NumberFormat


  FractionStyle values:

    ShowAsDecimal - Show fractional values as decimal fraction.
    ShowAsFraction - Show fractional value as fraction.
    Round - Round fractional values to the nearest whole integer.
    Truncate - Truncate to achieve whole units.

NumberFormatList class was added into Measure class

the class represents Represents list of number formats.

Constructor

    public NumberFormatList(Measure measure)
Properties


    get_Item(int) and set_Item(int index, NumberFormat value) - Gets or sets number format in list by its index.
    getCount()- Count if items in the list.


Methods

    public void add(NumberFormat value)

     Adds number format to list.
    public void insert(int index, NumberFormat value)
     Inserts number format into list.


    public void removeAt(int index)
     Removes number format from list.

Measure property was added to LineAnnotation and PolyLineAnnotation classes. 


Examples:

Following example demonstrates how to use Measure with LineAnnotation:

Document doc = new Document("source.pdf");
Rectangle rect = new Rectangle(260, 630, 451, 662);
LineAnnotation line = new LineAnnotation(doc.getPages().get_Item(1), rect, new Point(266, 657), new Point(446, 656));
line.setColor (Color.getRed());
//set extension line parameters.
line.setLeaderLine (-15);
line.setLeaderLineExtension (5);
//set line endings 
line.setStartingStyle (LineEnding.OpenArrow);
line.setEndingStyle (LineEnding.OpenArrow);

//create Measure element
line.setMeasure (new Measure(line));
line.getMeasure().setDistanceFormat (new Measure.NumberFormatList(line.getMeasure()));
line.getMeasure().getDistanceFormat().add(new Measure.NumberFormat(line.getMeasure()));
line.getMeasure().getDistanceFormat().get_Item(1).setUnitLabel ("mm");
line.getMeasure().getDistanceFormat().get_Item(1).setFractionSeparator (".");
line.getMeasure().getDistanceFormat().get_Item(1).setConvresionFactor (1);

//text of measure line
line.setContents ("155 mm");
//this must be set to show the text.
line.setShowCaption (true);
line.setCaptionPosition (CaptionPosition.Top);
doc.getPages().get_Item(1).getAnnotations().add(line);
doc.save("output.pdf");


Following example demonstrates how to use Measure with PolylineAnnotation:

Document doc = new Document("source.pdf");
Point[] vertices = new Point[]
{
new Point(100, 600), 
new Point(500, 600), 
new Point(500, 500), 
new Point(400, 300), 
new Point(100, 500), 
new Point(100, 600)
};
Rectangle rect = new Rectangle(100, 500, 500, 600);
//area or perimeter line
PolylineAnnotation area = new PolylineAnnotation(doc.getPages().get_Item(1), rect, vertices);
area.setColor (Color.getRed());
//line engins can be set for perimeter line. 
area.setStartingStyle (LineEnding.OpenArrow);
area.setEndingStyle (LineEnding.OpenArrow);
area.setMeasure  (new Measure(area));
area.getMeasure().setDistanceFormat (new Measure.NumberFormatList(area.getMeasure()));
area.getMeasure().getDistanceFormat().add(new Measure.NumberFormat(area.getMeasure()));
area.getMeasure().getDistanceFormat().get_Item(1).setUnitLabel ("mm");
doc.getPages().get_Item(1).getAnnotations().add(area);
doc.save("output.pdf");


Following code snippet demonstrates how to read Measure properties:

//read Measure properties
Document doc = new Document("measure.pdf");
System.out.println(((LineAnnotation)doc.getPages().get_Item(1).getAnnotations().get_Item(1)).getMeasure().getScaleRatio());
System.out.println(((LineAnnotation)doc.getPages().get_Item(1).getAnnotations().get_Item(1)).getMeasure().getAreaFormat().get_Item(1).getUnitLabel());
System.out.println(((LineAnnotation)doc.getPages().get_Item(1).getAnnotations().get_Item(1)).getMeasure().getAreaFormat().get_Item(1).getConvresionFactor());
System.out.println(((LineAnnotation)doc.getPages().get_Item(1).getAnnotations().get_Item(1)).getMeasure().getAreaFormat().get_Item(1).getFractionSeparator());

Breaking change - PdfPageEditor.Pages property was renamed to ProcessPages

Following code snippet shows the property usage (sets zoom coefficient for page #1 of the document):

PdfPageEditor editor = new PdfPageEditor();
editor.bindPdf("input.pdf");
editor.setZoom (0.5f);
editor.setProcessPages (new int[] { 1 });
editor.save("output.pdf");

Breaking change - RichTextBoxField.RValue property was renamed to RichTextValue

Following code snippet shows a sample where the renamed field was used:

Document doc = new Document("input.pdf");
RichTextBoxField rt = new RichTextBoxField(doc.getPages().get_Item(1), new Rectangle(50, 600, 250, 650));
rt.setPartialName ("rt");
doc.getForm().add(rt);
doc.save("34834.pdf");
Document doc1 = new Document("34834.pdf");
((RichTextBoxField)doc1.getForm().get("rt")).setRichTextValue ("<p>This is my <b>paragraph</b></p>");
doc1.save("output.pdf");

InsertBlankColumnAtFirst option was added into ExcelSaveOptions.

Following code snippet shows how to suppress appearing of first blank column:

Document doc = new Document(inFile);
ExcelSaveOptions options = new ExcelSaveOptions();
options.setInsertBlankColumnAtFirst (false);
doc.save(outFile, options);

PageInfo propertty was added to SvgLoadOptions class.

Following code snippet shows how to use SvgLoadOptions and set margin info with PageInfo property:

SvgLoadOptions options = new SvgLoadOptions();
options.ConversionEngine = SvgLoadOptions.ConversionEngines.NewEngine;
options.getPageInfo().getMargin().setTop (0);
options.getPageInfo().getMargin().setLeft (0);
options.getPageInfo().getMargin().setBottom (0);
options.getPageInfo().getMargin().setRight (0);
String inFile = "35730.svg";
String outFile = "35730.pdf";
Document pdfDocument = new Document(inFile, options);
pdfDocument.save(outFile);

ConversionEngines enumeration was added to SvgLoadOptions class.

Following values are defined:
LegacyEngine - legacy engine of Svg processing
NewEngine - new Svg processing engine 

ConversionEngine property was added to SvgLoadOptions class
 The LegacyEngine is still default value because NewEngine is in B-testing stages.

Following code snippet shows sample how to use new engine:

SvgLoadOptions options = new SvgLoadOptions();
options.ConversionEngine = SvgLoadOptions.ConversionEngines.NewEngine;
String inFile = "36516_2_income.svg";
String outFile = "36516_2_income.pdf";
Document pdfDocument = new Document(inFile, options);
pdfDocument.save(outFile);

ColumnAdjustment property was added to Table class
ColumnAdjustment enumeration was adde into Aspose.Pdf namespace

following values were added:
Customized - The user sets the ColumnWidth manually.
AutoFitToContent - Performs auto fit to content


ColumnAdjustment property was added to Table class
The Default value is Customized

Following code snippet shows sample of the ColumnAdjustment peoperty usage:

Table hTable = new Table();
hTable.getMargin().setTop (4);
hTable.setDefaultCellBorder (new BorderInfo(BorderSide.All, 0.5F, Color.getBlack()));
hTable.setDefaultCellPadding (new MarginInfo(1, 1, 1, 1));
hTable.setAlignment (HorizontalAlignment.Left);
hTable.setColumnAdjustment (ColumnAdjustment.AutoFitToContent);

MinimizeTheNumberOfWorksheets property was introduced into ExcelSaveOptions object.

Following code snippet shows how to minimize possible number of worksheets:

Document doc = new Document("Original.pdf");
ExcelSaveOptions options = new ExcelSaveOptions();
//Set this property to true
options.setMinimizeTheNumberOfWorksheets (true);
doc.save("output.xls", options);

Default value was added to PageLayout enumeration.

Following code snippet sets PageLayout to Default value:

Document doc1 = new Document("input.pdf");
doc1.setPageLayout (PageLayout.Default);
doc1.save("output.pdf");

Rounded Ends support was implemented for InkAnnotation

CapStyle enumaration was added into com.aspose.pdf package

following values are present"
Rectangular - Default specified value
Rounded - rounded corners

CapStyle property was added to InkAnnotation class


Following code snippet shows how to set the InkAnnotation corners as rounded:

Document doc = new Document("PdfWithText.pdf");
Page pdfPage = doc.getPages().get_Item(1);
java.awt.Rectangle drect = new java.awt.Rectangle();
drect.height =(int)pdfPage.getRect().getHeight();
drect.width = (int)pdfPage.getRect().getWidth();
drect.x = 0;
drect.y = 0;
com.aspose.pdf.Rectangle arect = com.aspose.pdf.Rectangle.fromRect(drect);
java.util.ArrayList inkList = new java.util.ArrayList();
com.aspose.pdf.Point[] arrpt = new com.aspose.pdf.Point[3];
inkList.add(arrpt);
arrpt[0] = new Point(100, 800);
arrpt[1] = new Point(200, 800);
arrpt[2] = new Point(200, 700);
InkAnnotation ia = new InkAnnotation(pdfPage, arect, inkList);
ia.setTitle ("XXX");
ia.setColor (Color.getLightBlue());
ia.setCapStyle (CapStyle.Rounded);
Border border = new Border(ia);
border.setWidth (25);
ia.setOpacity (0.5);
pdfPage.getAnnotations().add(ia);
doc.save("37071.pdf");

PDFNEWJAVA-33498 Provide support to add Image from BufferedImage into PDF document

Following code snippet shows adding Image from BufferedImage:

BufferedImage originalImage = ImageIO.read(new File("c:\\image\\anyImage.jpg"));
Document pdfDocument1 = new Document();
Page page2 = pdfDocument1.getPages().add();
page2.getResources().getImages().add(originalImage)

PDFNEWJAVA-34088 PDF to HTML conversion: To specify image folder

Following code snippet shows how to specify image folder:

   Document pdfDocument = new Document(testdata + "PDFNEWJAVA_34088.pdf");
   HtmlSaveOptions saveOptions = new HtmlSaveOptions();
   saveOptions.SpecialFolderForAllImages = testdata + "SpecialFolderForAllImages";        
   pdfDocument.save(testout + "PDFNEWJAVA_34088.html", saveOptions);

PDFNEWJAVA-33203 Setting DPI/PPI of images in PDF

Following code snippet shows how to change image resolution in the pdf file:

initLicense();
String myDir = "D:\\Temp\\";
File fileIn = new File(myDir+"image.jpg");
FileInputStream in = new FileInputStream(fileIn);
 
File fileOut = new File(myDir+"image.pdf");
FileOutputStream out = new FileOutputStream(fileOut);
 //test pdf creation
Document doc = new Document();
Page page = doc.getPages().add();
com.aspose.pdf.Image image1 = new com.aspose.pdf.Image();
image1.setImageStream(in);
image1.setFixHeight(page.getMediaBox().getHeight()/4);
image1.setFixWidth(page.getMediaBox().getWidth()/2);
NewParagraphPlacementInfo placementInfo = new NewParagraphPlacementInfo();
        placementInfo.setStartNewPage(true);
page.getParagraphs().add(image1, placementInfo);
page.getPageInfo().getMargin().setLeft(5);
page.getPageInfo().getMargin().setRight(0);
page.getPageInfo().getMargin().setTop(0);
page.getPageInfo().getMargin().setBottom(0); 
doc.save(out);
//internal image resolution change
doc = new Document(myDir+"image.pdf");
XImageCollection images = doc.getPages().get_Item(1).getResources().getImages();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
images.get_Item(1).save(baos, 10, 10);//define horizontal and vertical resolutions
images.get_Item(1).replace(new ByteArrayInputStream(baos.toByteArray()));
doc.save(myDir+"imageWithNewResolution.pdf");


Summary:
Added classes:
com.aspose.pdf.drawing.Ellipse
com.aspose.pdf.drawing.Path
com.aspose.pdf.generator.legacyxmlmodel.BadHtmlHandlingStrategy
com.aspose.pdf.generator.legacyxmlmodel.BookmarkIncludeType
com.aspose.pdf.generator.legacyxmlmodel.BorderSide
com.aspose.pdf.generator.legacyxmlmodel.ColumnInfo
com.aspose.pdf.generator.legacyxmlmodel.HeaderFooterType
com.aspose.pdf.generator.legacyxmlmodel.HtmlInfo
com.aspose.pdf.generator.legacyxmlmodel.ImportOptions
com.aspose.pdf.generator.legacyxmlmodel.MediaType
com.aspose.pdf.generator.legacyxmlmodel.PathArea
com.aspose.pdf.generator.legacyxmlmodel.TableFormatInfo
com.aspose.pdf.AutoDetectedFormatLoadOptions
com.aspose.pdf.CapStyle
com.aspose.pdf.ColumnAdjustment
com.aspose.pdf.ComHelper
com.aspose.pdf.EpubLoadOptions
com.aspose.pdf.EpubSaveOptions
com.aspose.pdf.FileFontSource
com.aspose.pdf.FontAbsorber
com.aspose.pdf.HtmlFragment
com.aspose.pdf.Measure
com.aspose.pdf.MemoryFontSource

com.aspose.pdf.facades.Form:
Changes:
public java.util.Map getButtonOptionValues(String fieldName) -> public java.util.Hashtable<String,String> getButtonOptionValues(String fieldName)

com.aspose.pdf.facades.PdfConverter:
Added:
public int getCoordinateType()
public void setCoordinateType(int value) 
Depricated:
public boolean getShowHiddenAreas()
public void setShowHiddenAreas(boolean value)

com.aspose.pdf.facades.PdfFileInfo:
Changes:
public java.util.Map getHeader() -> public java.util.Map<String, String> getHeader() 
public void setHeader(java.util.Map value) -> public void setHeader(java.util.Map<String,String> value

com.aspose.pdf.facades.PdfFileSignature:
Depricated:
public boolean isContainSignature()
public boolean isCoversWholeDocument(String signName)
Added:
public boolean containsSignature()
public boolean containsUsageRights()
public void removeUsageRights()
com.aspose.pdf.facades.PdfPageEditor:
Changes:
public int[] getPages_Rename_Namesake() -> public int[] getProcessPages() 
public void setPages(int[] value) -> public void setProcessPages(int[] value)
public java.util.Map getPageRotations() -> public java.util.Map<Integer, Integer> getPageRotations()
public void setPageRotations(java.util.Map value) -> public void setPageRotations(java.util.Map<Integer, Integer> value) 

com.aspose.pdf.facades.PdfViewer:
Depricated:
public boolean getShowHiddenAreas()
public void setShowHiddenAreas(boolean value) 
Added:
public int getCoordinateType()
public void setCoordinateType(int value) 
com.aspose.pdf.facades.PdfXmpMetadata:
Changes:
public IDictionary getExtensionFields() -> public java.util.Hashtable<String, XmpPdfAExtensionSchema> getExtensionFields()
com.aspose.pdf.generator.legacyxmlmodel.Attachment:
Added:
public InputStream AttachedStream
com.aspose.pdf.generator.legacyxmlmodel.BorderInfo:
Added:
public void setBorderStyle(int borderSide, int style)
com.aspose.pdf.generator.legacyxmlmodel.BoxVerticalAlignmentType
Removed Depricated status from the class

com.aspose.pdf.generator.legacyxmlmodel.Cell:
Added:
public TextInfo getDefaultCellTextInfo()
public void setDefaultCellTextInfo(TextInfo value)
public String getText()
com.aspose.pdf.generator.legacyxmlmodel.HeaderFooter:
Added:
public Object completeClone()
public Object completeCloneAll()
com.aspose.pdf.generator.legacyxmlmodel.Heading:
Removed Depricated status from:
public int getBulletAlignment()
public void setBulletAlignment(int value)

com.aspose.pdf.generator.legacyxmlmodel.Image:
Added:
public Image(HeaderFooter hf)
com.aspose.pdf.generator.legacyxmlmodel.JavaScripts:
Added:
public void remove(Cell jsToRemove)
com.aspose.pdf.generator.legacyxmlmodel.LegacyPdf:
Added:
public boolean DigitSubstitution
public boolean IsAutoFontAdjusted
public boolean IsBuffered
public InputStream TruetypeFontMapStream
public boolean IsImageNotFoundErrorIgnored
public boolean Linearized;
public int getPageCount()
public void save(OutputStream output)
public byte[] getBuffer()
public void save(String pdfFile)
public void bindXML(String xmlFile, String xslFileIfAny)
public void bindXML(InputStream xmlStream, InputStream xslStream)
public void setUnicode()
public Object getObjectByID(String ID)
public HtmlInfo HtmlInfo
Added Deprecated:
    public int getBookMarkLevel()
public void setBookMarkLevel(int value)
public int getDirectModeItemType()
public void setDirectModeItemType(int value)
public int getDirectModeItemsCount()
public void setDirectModeItemsCount(int value)

com.aspose.pdf.generator.legacyxmlmodel.LinkAction:
Added:
public String SoundFileName

com.aspose.pdf.generator.legacyxmlmodel.Paragraphs:
Added:
public void add(Paragraph paragraph)
void addHeading(Paragraph paragraph)
public int indexOf(Paragraph paragraph)
public void copyTo(Paragraph[] paraArray, int index)
public void insert(Paragraph paragraphToInsertAfter, Paragraph newParagraph)
com.aspose.pdf.generator.legacyxmlmodel.Row:
Changed:
DefaultCellTextInfo into getter and setter field
Added:
public TextInfo getDefaultCellTextInfo()
public void setDefaultCellTextInfo(TextInfo value)
public Object deepClone()
com.aspose.pdf.generator.legacyxmlmodel.Section:
Added:
public ColumnInfo ColumnInfo
public int getPageCount()
public void setPageCount(int value)
public String BreakParaText
public Object deepClone()
public Object completeClone()
public HeaderFooter insertHeader(int type)
public HeaderFooter insertFooter(int type)
public Object getObjectByID(String ID)
com.aspose.pdf.generator.legacyxmlmodel.Sections:
Added:
public Sections()
public Section add()
public void insert(int index, Section section)
public void insert(Section sectionToInsertAfter, Section newSection)
public void remove(Section sectionToRemove)
public void copyTo(Section[] secArray, int index)
public int indexOf(Section section)
public void set_Item(int index, Section value)
public Section get_Item(String sectionID)
public void set_Item(String sectionID, Section value)
com.aspose.pdf.generator.legacyxmlmodel.Security:
Added:
public boolean isDefaultAllAllowed()
public void setDefaultAllAllowed(boolean value)
com.aspose.pdf.generator.legacyxmlmodel.Shapes:
Added:
public void add(Shape shape)
public void remove(Shape shapeToRemove)
public void copyTo(Shape[] shapeArray, int index)
public int indexOf(Shape shape)
com.aspose.pdf.generator.legacyxmlmodel.Table:
Changed:
FixedWidth into getter and setter field
DefaultCellTextInfo into getter and setter field
Added:
public float getFixedWidth()
public void setFixedWidth(float value)
public TextInfo getDefaultCellTextInfo()
public void setDefaultCellTextInfo(TextInfo value)
public Cell getCell(int row, int column, boolean isTableChanged)
public void formatColumnsWithFormatInfo(TableFormatInfo info, int firstColumn, int maxColumns)
public void formatTableWithFormatInfo(TableFormatInfo info, int firstColumn, int firstRow, int maxRows, int maxColumns)
public void formatRowsWithFormatInfo(TableFormatInfo info, int firstRow, int maxRows)
public void setColumnWidth(int columnNumber, float width)
public String getColumnWidths()
public void setColumnWidths(String value)
com.aspose.pdf.generator.legacyxmlmodel.TabStops:
Added:
public int getCapacity()
public void setCapacity(int value) 
com.aspose.pdf.generator.legacyxmlmodel.TextInfo:
Changed:
The next list of the fields was changed to the separate getter and setter field:
FontSize, FontName, TruetypeFontFileName, IsUnicode, FontAfmFile, FontPfmFile, FontOutlineFile, FontEncodingFile, IsTrueTypeFontBold, IsTrueTypeFontItalic,FontEncoding, IsFontEmbedded, IsUnderline,
IsOverline,CharSpace, WordSpace, LineSpacing, OverlineOffset, UnderlineOffset, _RenderingMode, Color, BackgroundColor, IsRightToLeft, StrokeWidth, StrokeColor, IsBaseline, Alignment.
Added:
public float getFontSize()
public void setFontSize(float value)
public String getFontName()
public void setFontName(String value)
public String getTruetypeFontFileName()
public void setTruetypeFontFileName(String value)
public boolean isUnicode()
public void setUnicode(boolean value)
public String getFontAfmFile()
public void setFontAfmFile(String value)
public String getFontPfmFile()
public void setFontPfmFile(String value)
public String getFontOutlineFile()
public void setFontOutlineFile(String value)
public String getFontEncodingFile()
public void setFontEncodingFile(String value)
public boolean isTrueTypeFontBold()
public void setTrueTypeFontBold(boolean value)
public boolean isTrueTypeFontItalic()
public void setTrueTypeFontItalic(boolean value)
public String getFontEncoding()
public void setFontEncoding(String value)
public boolean isFontEmbedded()
public void setFontEmbedded(boolean value)
public boolean isUnderline()
public void setUnderline(boolean value)
public boolean isOverline()
public void setOverline(boolean value)
public float getCharSpace()
public void setCharSpace(float value)
public float getWordSpace()
public void setWordSpace(float value)
public float getLineSpacing()
public void setLineSpacing(float value)
public float getOverlineOffset()
public void setOverlineOffset(float value)
public float getUnderlineOffset()
public void setUnderlineOffset(float value)
public int getRenderingMode()
public void setRenderingMode(int value)
public Color getColor()
public void setColor(Color value)
public Color getBackgroundColor()
public void setBackgroundColor(Color value)
public boolean isRightToLeft()
public void setRightToLeft(boolean value)
public float getStrokeWidth()
public void setStrokeWidth(float value)
public Color getStrokeColor()
public void setStrokeColor(Color value)
public boolean isBaseline()
public void setBaseline(boolean value)
public int getAlignment()
public void setAlignment(int value)
com.aspose.pdf.BaseOperatorCollection:
Changes:
implements ICollection -> implements ICollection<Operator>
com.aspose.pdf.Border:
Changes:
public int getVCornerRaduis() -> public int getVCornerRadius()
public void setVCornerRaduis(int value) -> public void setVCornerRadius(int value)
Added Deprecated:
public int getVCornerRaduis()
public void setVCornerRaduis(int value)
com.aspose.pdf.DataUtils
Changes: 
Internalized

com.aspose.pdf.ExcelSaveOptions:
Added:
public boolean getMinimizeTheNumberOfWorksheets()
public void setMinimizeTheNumberOfWorksheets(boolean value)
public boolean getInsertBlankColumnAtFirst()
public void setInsertBlankColumnAtFirst(boolean value)
public boolean getUniformWorksheets()
public void setUniformWorksheets(boolean value)
com.aspose.pdf.Font:
Added:
public void save(OutputStream stream)
com.aspose.pdf.Form:
Added:
public FieldsEnumerator(IDocument document, List<Object> fields)
com.aspose.pdf.HtmlSaveOptions:
Added:
public FontSourceCollection getFontSources()
com.aspose.pdf.InkAnnotation:
Added:
public int getCapStyle()
public void setCapStyle(int value)
com.aspose.pdf.LineAnnotation:
Added:
public Measure getMeasure()
public void setMeasure(Measure value)
com.aspose.pdf.LoadFormat:
Changes: 
public static final int InfoPath - was removed
public static final int AutoDetect - Added

com.aspose.pdf.Metadata:
Changes: 
public IDictionary getExtensionFields() -> public java.util.Hashtable<String, XmpPdfAExtensionSchema> getExtensionFields() 
com.aspose.pdf.PageLayout:
Added:
public static final int Default
com.aspose.pdf.PolylineAnnotation:
Added:
public Measure getMeasure()
public void setMeasure(Measure value)
com.aspose.pdf.PopupAnnotation:
Added:
    public MarkupAnnotation getParent()
public void setParent(MarkupAnnotation value)
com.aspose.pdf.RichTextBoxField:
Changes: 
public String getRValue() -> public String getRichTextValue() 
public void setRValue(String value) -> public void setRichTextValue(String value)
com.aspose.pdf.SaveOptions.BorderPartStyle
Added:
public java.awt.Color color
com.aspose.pdf.SvgLoadOptions:
Added:
public static final class ConversionEngines
public int ConversionEngine
public PageInfo getPageInfo()
public void setPageInfo(PageInfo value)
com.aspose.pdf.Table:
Added:
public int getColumnAdjustment()
public void setColumnAdjustment(int value)

com.aspose.pdf.TextFragmentAbsorber:
Added:
public TextReplaceOptions getTextReplaceOptions()
public void setTextReplaceOptions(TextReplaceOptions value) 
com.aspose.pdf.TextReplaceOptions:
Added:
public static final class ReplaceAdjustment
public int getReplaceAdjustmentAction()
public void setReplaceAdjustmentAction(int value)
public TextReplaceOptions(int adjustment, int scope)

com.aspose.pdf.XFA:
Added:
public void setFieldImage(String fieldName, InputStream image)

Aspose.Pdf for Java 9.5.2

$
0
0
We are pleased to announce the release of latest hotfix containing resolution of some high priority issues.

New Feature:
  • PDFNEWJAVA-33817 PDF to EPUB support
Enhancements:
  • PDFNEWJAVA-34358 Processing time increased with Aspose.Pdf for Java 9.3.1
Bugs:
  • PDFNEWJAVA-34466 Problems with getting an information from tagged pdf
  • PDFNEWJAVA-34366 PDF to PNG - Images are missing in resultant PNG
  • PDFNEWJAVA-34410 PDF to Image - Logo in resultant file is not correct
  • PDFNEWJAVA-34459 PDF to Image: Highlight annotation loses the transparency
  • PDFNEWJAVA-34053 Using PdfFileMend.SetInputStream(), corrupts the output file
  • PDFNEWJAVA-34057 Unable to find font and IllegalStateException exception is raised
  • PDFNEWJAVA-34340 PDF to PNG - Highlighted text is not visible
  • PDFNEWJAVA-34361 PDF to HTML: text is missing
  • PDFNEWJAVA-34168 PDF to DOC: URL rendering issue
  • PDFNEWJAVA-34456 XPS to PDF: Image rendering issue
  • PDFNEWJAVA-34115 Loading Image via URL is not working
  • PDFNEWJAVA-34465 HTML to PDF - Exception during conversion
  • PDFNEWJAVA-34478 PDF to SVG conversion throws exception
Public API and Backwards Incompatible Changes

PDFNEWJAVA-33817 PDF to EPUB support

Implemented PDF to EPUB converter.

Example:

Document doc = new Document("Alice.pdf");
 EpubSaveOptions options3 = new EpubSaveOptions();
 doc3.save("Alice.epub", options3);

PDFNEWJAVA-34489 - Remove PdfFormat.Tagged_PDF from public API
PdfFormat.Tagged_PDF constant was removed.

In PdfFileMend class was depricated constructor: 
public PdfFileMend(FileInputStream inputStream, FileOutputStream outputStream)

Aspose.Pdf for Java 9.7.0

$
0
0
We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Features:
PDFNEWJAVA-34192 Support PDF to DOCX conversion
PDFNEWJAVA-34252 Convert PDF to Single Web Archive (MHT file)

Enhancements:
PDFNEWJAVA-34570 Memory is not released after process completion/exits.
PDFNEWJAVA-34357 Memory leak issue
Fixed Bugs:
PDFNEWJAVA-34275 NullPointerException - When converting PDF files to JPG
PDFNEWJAVA-34294 TIFF to PDF - Resultant PDF is blank
PDFNEWJAVA-34529 TIFF to PDF - Exception during image conversion
PDFNEWJAVA-34125 Only first frame of TIFF is converted to PDF
PDFNEWJAVA-34474 Tiff to PDF throws unsupported file format exception
PDFNEWJAVA-34477 TIFF to PDF - Exception during conversion
PDFNEWJAVA-33624 Add a watermark to the same PDF
PDFNEWJAVA-34259 Saving back to the same document throws InvalidPdfFileFormatException exception
PDFNEWJAVA-34482 Multipage TIFF to PDF throws exception
PDFNEWJAVA-34515 Pdf to Image conversion problems for different values of DPI
PDFNEWJAVA-34404 Pdf to text: space between text increased
PDFNEWJAVA-34444 PDF to PDFA: PDFA compliance fails
PDFNEWJAVA-34271 XPS to PDF - Exception during conversion
PDFNEWJAVA-33989 Exception while extracting text from PDF file
PDFNEWJAVA-34423 PDF to Image: loses PolygonAnnotation
PDFNEWJAVA-34532 PDF to HTML - Font missing exception
PDFNEWJAVA-34523 NullPointerException when attempting to get all text from PDF


Public API and Backwards Incompatible Changes

Some untyped public API members has become typed

Changes in com.aspose.pdf.facadesFormattedText class:
public ArrayList getText() -> public List<String> getText()

Changes in com.aspose.pdf.facadesPdfExtractor class:
public Iterable getAttachmentInfo() -> public List<FileSpecification> getAttachmentInfo()

Changes in com.aspose.pdf.facadesPdfFileMend class:
public boolean addText(FormattedText text, int[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY) -> public boolean addText(FormattedText text, Integer[] pageNums, float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY)

Changes in com.aspose.pdf.generator.legacyxmlmodel.Cell class:
public float FitWidth= 100; -> public float getFitWidth() and public void setFitWidth(float value)

Changes in com.aspose.pdf.generator.legacyxmlmodel.Graph class:
public float GraphWidth -> public float getGraphWidth() and public void setGraphWidth(float value)
public float GraphHeight -> public float getGraphHeight() and public void setGraphHeight(float value)

Changes in com.aspose.pdf.generator.legacyxmlmodel.Heading class:
added:
public /*new*/ boolean IsAutoHyphenated
public /*new*/ Object completeClone_Heading_New()

Changes in com.aspose.pdf.generator.legacyxmlmodel.Heading class:
added:
public String FinalXmStorageFile

Changes in com.aspose.pdf.generator.legacyxmlmodel.Row class:
divided: public float FixedRowHeight -> public float getFixedRowHeight() and public void setFixedRowHeight(float value)

Changes in com.aspose.pdf.generator.legacyxmlmodel.Section class:
moved:
public int ColumnCount
public String ColumnWidths
public String ColumnSpacing

Changes in com.aspose.pdf.Document class:
added: public void afterImport()

Changes in com.aspose.pdf.AppearanceDictionary class:
public XForm get_Item(Object key) -> public XForm get_Item(String key)
public void set_Item(Object key, XForm value) -> public void set_Item(String key, XForm value)
added:
public java.util.List<String> getKeys_()
public java.util.List<XForm> getValues_()
public void addItem(String key, XForm value)
public boolean containsKey(String key)
public boolean removeItemByKey(String key)
public boolean tryGetValue(String key, /*out*/ Object[] value)
deprecated:
public boolean contains(Object key)
public void removeItemInternal(Object key)
public void add(Object key, Object value)
public XForm get(Object key)

Changes in com.aspose.pdf.Artifact class:
public Artifact(ArtifactCollection owner, Resources resources, Matrix matrix, ArrayList _contents, IPdfDictionary _properties ) -> public Artifact(ArtifactCollection owner, ArtifactContext context, List<Operator> _contents, IPdfDictionary _properties)

Changes in com.aspose.pdf.ArtifactCollection class:
public IList findByValue(String name, String expectedValue) -> public List<Artifact> findByValue(String name, String expectedValue)

Changes in com.aspose.pdf.Cells class:
deprecated:
public void remove(Object obj)
added:
public void remove(Cell cell)

Changes in com.aspose.pdf.CheckboxField class:
public java.util.ArrayList getAllowedStates() -> public java.util.List<String> getAllowedStates()

Changes in Color class:
added: extends Brush
public Color deepClone()

Changes in com.aspose.pdf.Image class:
added:
public /*ImageFileType*/int getFileType()
public void setFileType(/*ImageFileType*/int value)

Changes in com.aspose.pdf.InkAnnotation class:
public InkAnnotation(Page page, Rectangle rect, List inkList) -> public InkAnnotation(Page page, Rectangle rect, List<Point[]> inkList)
public IList getInkList() -> public List<Point[]> getInkList()
public void setInkList(IList value) -> public void setInkList(List<Point[]> value)

Changes in com.aspose.pdf.Operator class:
public java.util.ArrayList getParameters() -> public java.util.ArrayList<CommandParameter> getParameters()

Changes in Page class:
public java.util.List getLayers() -> public java.util.List<Layer> getLayers()
public void setLayers(java.util.ArrayList value) -> public void setLayers(java.util.ArrayList<Layer> value)
public IList findReferences(String name) -> public java.util.List<Object> findReferences(String name)
public static IList findReferences(OperatorCollection contents, String name) -> public static java.util.List<Object> findReferences(OperatorCollection contents, String name)
added:
public com.aspose.pdf.Rectangle calculateContentBBox()

Changes in com.aspose.pdf.PageCollection class:
public void delete(int[] pages) -> public void delete(Integer[] pages)
public void add(ICollection pages) -> public void add(Iterable pages)
public void insert(int pageNumber, ICollection pages) -> public void insert(int pageNumber, java.util.List<Page> pages)

Changes in com.aspose.pdf.Table class:
public double getLeft() -> public float getLeft()
public void setLeft(double value) -> public void setLeft(float value)
public double getTop() -> public float getTop()
public void setTop(double value) -> public void setTop(float value)

Added classes:
com.aspose.pdf.Brush
com.aspose.pdf.ImageFileType


RadiusForRoundCorner property was added into com.aspose.pdf.drawing.Rectangle class

Following code snippet shows how to use RadiusForRoundCorner property:

String outFile = "output.pdf";
Document doc = new Document();
Page page = doc.getPages().add();
Graph root = new Graph(100, 100);
com.aspose.pdf.drawing.Rectangle rect = new com.aspose.pdf.drawing.Rectangle(0, 0, 100, 100);
rect.getGraphInfo().setColor (Color.getBlue());
rect.setRadiusForRoundCorner (10);
root.getShapes().add(rect);
page.getParagraphs().add(root);
doc.save(outFile);


Left and Top properties were added into com.aspose.pdf.drawing.Graph class

Following code snippet shows how to use Left, Top properties:

String outFile = "output.pdf";
Document doc = new Document();
Page page = doc.getPages().add();
Graph root = new Graph(100, 100);
root.setLeft (300);
root.setTop (300);
com.aspose.pdf.drawing.Rectangle rect = new com.aspose.pdf.drawing.Rectangle(0, 0, 100, 100);
root.getShapes().add(rect);
page.getParagraphs().add(root);
doc.save(outFile);


calculateContentBBox method was added into com.aspose.pdf.Page object

Following code snippet shows how to trim whitespace from Pdf document:

Document document = new Document("input.pdf");
Page pdfPage = document.getPages().get_Item(1);

Rectangle contentBBox = pdfPage.calculateContentBBox();

document.getPages().get_Item(1).setCropBox (contentBBox);
document.getPages().get_Item(1).setMediaBox (contentBBox);

document.save("output.pdf");


resizeContents method that accepts Document object was added into PdfFileEditor class:

resizeContents(doc, parameters);

Following code snippet shows how to use ResizeContents(doc, parameters) method:

//Create PdfFileEditor Object
PdfFileEditor fileEditor = new PdfFileEditor();

//Open PDF Document
Document doc = new Document("input.pdf");

//Specify Parameter to be used for resizing
PdfFileEditor.ContentsResizeParameters parameters = new PdfFileEditor.ContentsResizeParameters(
//left margin = 10% of page width
PdfFileEditor.ContentsResizeValue.percents(30),
//new contents width calculated automatically as width - left margin - right margin (100% - 10% - 10% = 80%)
null,
//right margin is 10% of page
PdfFileEditor.ContentsResizeValue.percents(30),
//top margin = 10% of height
PdfFileEditor.ContentsResizeValue.percents(30),
//new contents height is calculated automatically (similar to width)
null,
//bottom margin is 10%
PdfFileEditor.ContentsResizeValue.percents(30)
);

//Resize Page Contents
fileEditor.resizeContents(doc, parameters);

//save document into new location.
doc.save("output.pdf");



PartsEmbeddingModes enumeration was added into com.aspose.pdf.HtmlSaveOptions class.

The PartsEmbeddingModes enumeration includes following values:

EmbedAllIntoHtml
Enforces embed all referenced files(Css,Images,Fonts) into generated HTML markup (i.e. into HTML itself)
This approach generates one HTML file, but total size of output
becames bigger(because Base64 encoding of binaries is in use) and not all browsers (especially legacy)
successfully process binaries embedded into HTML. But it allows get HTML that contains whole result, without any additional files.

EmbedCssOnly
Enforces put apart all referenced files except CSS (Images and Fonts)
I.e. CSS will be embedded into result HTML , and all other referenced files(Images and Fonts)
will be processed as external parts
It generates HTML that is sutable for wide set of browsers

NoEmbedding
Enforces put apart referenced files(Css,Images,Fonts)
This approach generates set of files, but total size of output
becames smaller(because no Base64 encoding of binaries is in use)
Also such approach generates HTML that is sutable for wide set of browsers


PDFNEWJAVA-34252 Convert PDF to Single Web Archive
Following code snippet demonstrates how to embed all resources into html:

Document doc = new Document("input.pdf");

HtmlSaveOptions newOptions = new HtmlSaveOptions();

// this is usage of tested feature
newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;

// this is just optimozation for IE and can be omitted
newOptions.LettersPositioningMethod = LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
//
String outHtmlFile = "output.html";
doc.save(outHtmlFile, newOptions);


GraphInfo property of com.aspose.pdf.drawing.Graph class is marked as obsolete.

GraphInfo properties of Shape objects of Graph.getShapes() collection should be used instead.

Following code snippet shows how to use GraphInfo properties of a Graph's Shape.

Document doc = new Document();
Helper.setLicense();
//Create a section in the Pdf document
Page page = doc.getPages().add();
//Create a graph in the section with Width=100 and Height=400
Graph graph1 = new Graph(50, 150);
//Add the graph object to paragraphs collection of the section
page.getParagraphs().add(graph1);

float[] lineArr = new float[] {110, 10, 10, 10, 10, 110, 110, 110};
Line line = new Line(lineArr);
line.getGraphInfo().setLineWidth (10);
//Set fill color of the circle using GraphInfo property of circle object
line.getGraphInfo().setFillColor (Color.getGreen());
//Enable the circle to be filled with the color specified above line
graph1.getShapes().add(line);

Arc arc = new Arc(110, 60, 50, 90, -90);
graph1.getShapes().add(arc);
arc.getGraphInfo().setColor (Color.getRed());
arc.getGraphInfo().setFillColor (Color.getYellow());
arc.getGraphInfo().setLineWidth (10);
//Enable the circle to be filled with the color specified above line
doc.save("output.pdf");


Aspose.Pdf for Java 9.7.1

$
0
0
  We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Features:
PDFNEWJAVA-33818 EPUB to PDF support
PDFNEWJAVA-33678 Converting non searchable PDF to searchable PDF document

Fixed Bugs:
PDFNEWJAVA-34558 TextFragment Underline formatting is not working
PDFNEWJAVA-34616 PDF to PDF/A - Resultant file is not correct
PDFNEWJAVA-34614 PDF file is not properly being converted to PDF/A_1a format
PDFNEWJAVA-34441 TextFragment Annotation characters overlap issue
PDFNEWJAVA-34566 PDF Table cells rowspan not working, when page breaks
PDFNEWJAVA-34575 NullPointerException is being generated while creating PDF file
PDFNEWJAVA-34567 Systematic NullPointerException while using API
PDFNEWJAVA-34491 When replacing text, contents overlap in resultant file
PDFNEWJAVA-34259 Saving back to the same document throws InvalidPdfFileFormatException exception
PDFNEWJAVA-33934 PDF to DOC: Table rendered incorrectly
PDFNEWJAVA-33932 PDF to DOC: Image rendering issue
PDFNEWJAVA-33998 PCL to PDF: Some text is broken
PDFNEWJAVA-34550 PDF to HTML: incorrect Encoding of output HTML
PDFNEWJAVA-33993 PDF to DOC - Page contents are not properly being rendered
PDFNEWJAVA-34167 PDF to DOC: bullet list is rendered incorrectly
PDFNEWJAVA-33476 Aspose PDF for Java 4.0 throwing exceptions on Linux
PDFNEWJAVA-33464 Problem while adding EMF image to PDF
PDFNEWJAVA-33507 ImportXML() method is not working
PDFNEWJAVA-33592 PdfFIleInfo class is malfunctioning
PDFNEWJAVA-34049 NullPointerException while adding TextStamp to PDF file
PDFNEWJAVA-34468 PDF to Image: 200 resolution trims output image
PDFNEWJAVA-34472 PDF to DOC - Missing Header text and formatting issues
PDFNEWJAVA-34501 Epub to PDF: NoClassDefFoundError
PDFNEWJAVA-33926 Wrong borders generates in the resulting file

Public API and Backwards Incompatible Changes

Added method:
com.aspose.facades.Form.importXml(String inputXml)

Changes:
com.aspose.pdf.generator.legacyxmlmodel.Heading:
isAutoSequence(boolean) -> setAutoSequence(boolean)
isInList(boolean) -> setInList(boolean)

PDFNEWJAVA-33818 EPUB to PDF support Implemented EPUB to PDF converter. Example: EpubLoadOptions optionsepub = new EpubLoadOptions(); Document docepub = new Document("Alice.epub", optionsepub); docepub.save("Alice.pdf");

PDFNEWJAVA-33678 Converting non searchable PDF to searchable PDF document This feature is implemented. This logic recognize text for pdf images. For recognition you may use outer OCR supports HOCR standard(http://en.wikipedia.org/wiki/HOCR). I have used free google tesseract OCR(http://en.wikipedia.org/wiki/Tesseract_%28software%29) Please install it to you computer from http://code.google.com/p/tesseract-ocr/downloads/list, after that you will have tesseract.exe console application. To inspect result Pdf visually, open the result output971.pdf in Adobe Reader and press Ctrl+A to select all the text. Example:

initLicense();
final String myDir = "D:\\LocalTesting\\";
Document doc = new Document(myDir + "input.pdf");
// Create callBack - logic recognize text for pdf images. Use outer OCR supports HOCR standard(http://en.wikipedia.org/wiki/HOCR).
// We have used free google tesseract OCR(http://en.wikipedia.org/wiki/Tesseract_%28software%29)
CallBackGetHocr cbgh = new CallBackGetHocr()
{
@Override
public String invoke(java.awt.image.BufferedImage img)
{
File outputfile = new File(myDir + "test.jpg");
try
{
ImageIO.write(img, "jpg", outputfile);
} catch (IOException e1)
{
e1.printStackTrace();
}

try
{
java.lang.Process process = Runtime.getRuntime()
.exec("tesseract" + " " + myDir + "test.jpg" + " " + myDir + "out hocr");
System.out.println("tesseract" + " " + myDir + "test.jpg" + " " + myDir + "out hocr");
process.waitFor();

} catch (IOException e)
{
e.printStackTrace();
} catch (InterruptedException e)
{
e.printStackTrace();
}

// reading out.html to string
File file = new File(myDir + "out.html");
StringBuilder fileContents = new StringBuilder((int) file.length());
Scanner scanner = null;
try
{
scanner = new Scanner(file);
String lineSeparator = System.getProperty("line.separator");

while (scanner.hasNextLine())
{
fileContents.append(scanner.nextLine() + lineSeparator);
}
} catch (FileNotFoundException e)
{
e.printStackTrace();
} finally
{
if (scanner != null)
scanner.close();
}

// deleting temp files
File fileOut = new File(myDir + "out.html");
if (fileOut.exists())
{
fileOut.delete();
}
File fileTest = new File(myDir + "test.jpg");
if (fileTest.exists())
{
fileTest.delete();
}


return fileContents.toString();
}
};
 // End CallBack

doc.convert(cbgh);
doc.save(myDir + "output971.pdf");

Aspose.Pdf for Java 10.0.0

$
0
0

  We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Features:

PDFNEWJAVA-34006 Extract text based on columns

Enhancement:

PDFNEWJAVA-33607 PKCS7 does not support a stream based Constructor
PDFNEWJAVA-34094 Font Folder issue on Non Windows operating systems


Fixed Bugs:

PDFNEWJAVA-34558 TextFragment Underline formatting is not working
PDFNEWJAVA-34695 Exception when loadding PDF processed wtih Apache PDFBox library
PDFNEWJAVA-34690 Extreme slow initial usage of Aspose.PDF/Aspose.Words in Tomcat 8
PDFNEWJAVA-34491 When replacing text, contents overlap in resultant file
PDFNEWJAVA-34680 Setting margin based on level in TOC
PDFNEWJAVA-33567 Digital signature is not properly being added to PDF file
PDFNEWJAVA-34601 TextBoxField.setValue() throws exception
PDFNEWJAVA-34137 verifySignature() method returning false
PDFNEWJAVA-34197 Formatting issues in TOC
PDFNEWJAVA-34350 Signature.verifySignature method is not recognizing signature
PDFNEWJAVA-34458 Exception when trying to extract/get font information for TextFragment
PDFNEWJAVA-34610 Decrypt/Encrypt results in corrupted document or error
PDFNEWJAVA-34606 PDF to HTML: space between text is lost
PDFNEWJAVA-34384 PDF to DOC: Space between text is increased
PDFNEWJAVA-34091 PDF to DOC - Formatting issues in resultant filer
PDFNEWJAVA-34272 PCL to PDF conversion throws NoClassDefFoundError exception
PDFNEWJAVA-34571 PDF to JPEG: White rectangle instead of image's part
PDFNEWJAVA-34555 HtmlFragments Issue: A string longer than a page throws exception.
PDFNEWJAVA-34431 PDF to XML: Resourced are saved in incorrect directory in Linux
PDFNEWJAVA-34425 PDF to DOC - Exception during conversion
PDFNEWJAVA-34022 PCL to PDF - Exception during conversion
Public API and Backwards Incompatible Changes

==============

Provided ContainsTransparency property in case SMasked image or stencil mask

Customers can get the transparency information to choose how it is better to save pictures in JPEG or PNG.

Example:

final Document pdfDocument = new Document(inputFile);
for (int pageCount = 1; pageCount <= 1; pageCount++)
{
    for (XImage image : (Iterable<XImage>) pdfDocument.getPages().get_Item(pageCount).getResources().getImages())
   {
     if (image.containsTransparency())
    {
      System.out.println("Internal image contains transparency");
    }
  }
}


==============

Feature to Identify if image in PDF is Colored or Black & White

Please use following code snippet to test it and take in attention the black and white images are represented as grayscaled in many cases:
Example:

final Document document = new Document("inputFile.pdf");
try /*JAVA: was using*/
{
   for (Page page : (Iterable<Page>) document.getPages())
   {
    ImagePlacementAbsorber abs = new ImagePlacementAbsorber();
    page.accept(abs);
    for (ImagePlacement ia : (Iterable<ImagePlacement>) abs.getImagePlacements())
    {
     /*ColorType*/int colorType = ia.getImage().getColorType();
     switch (colorType)
     {
     case ColorType.Grayscale:
     System.out.println("Grayscale Image");
     break;
     case ColorType.Rgb:
     System.out.println("Colored Image");
     break;
     }
    }
   }
}

==============

PDFNEWJAVA-34006 Extract text based on columns

Was implemented the next method:
TextExtractionOptions.setScaleFactor (double value); /* 0 */

From now during extracting text in 'Pure' mode You can specify ScaleFactor option.
This scale factor may be set to adjust grid that used for the internal text formatting mechanism during text extraction. Specifying of ScaleFactor values between 1 and 0.1 (including 0.1) has the same effect as font reducing. However the first is not change input document in contrast of second. And it works more faster and makes code more simple.
Specifying of ScaleFactor values between 0.1 and -0.1 is treated as zero value. It makes algorithm to calculate scale factor needed during extracting text automatically. The calculation is based on average glyph width of most popular font on the page. But we can not warrant that in extracted text no one string of column is reached the start of next column.
If ScaleFactor value is not specified, the default value of 1.0 will be used. It means no scaling will be carried out.
If specified ScaleFactor value is more than 10 or less than -0.1, the default value of 1.0 will be used.

We propose you to try use auto-scaling (ScaleFactor = 0) in mass processing PDF-document text content extraction. Or manually set redundant reducing of grid width ( about ScaleFactor = 0.5). You must not determine whether scaling is necessary for concrete document or not. If You set redundant reducing of grid width for the document (that doesn't need in it) the extracted text content will be remain fully adequate.

By default algorithm takes into account value of font size that have already reduced due to some internal reasons. For example reducing font size from 10 to 7 has the same effect as setting scale factor to 5/8 (= 0.625).

Example:

Document pdfDocument = new Document("inputFile.pdf");
TextAbsorber textAbsorber = new TextAbsorber();
textAbsorber.setExtractionOptions(new TextExtractionOptions(TextExtractionOptions.TextFormattingMode.Pure));
//Setting scale factor to 0.5 is enough to split columns in the majority of documents
//Setting of zero allows to algorithm choose scale factor automatically
textAbsorber.getExtractionOptions().setScaleFactor((double)0.5);
pdfDocument.getPages().accept(textAbsorber);
String extractedText = textAbsorber.getText();

==============

Feature to support of generating multi-layered PDF

Example:

Document doc = new Document();
Page page = doc.Pages.Add();
Layer layer = new Layer("oc1", "Red Line");
layer.Contents.Add(new Operator.SetRGBColorStroke(1, 0, 0));
layer.Contents.Add(new Operator.MoveTo(500, 700));
layer.Contents.Add(new Operator.LineTo(400, 700));
layer.Contents.Add(new Operator.Stroke());
page.Layers = new List<Layer>();
page.Layers.Add(layer);
layer = new Layer("oc2", "Green Line");
layer.Contents.Add(new Operator.SetRGBColorStroke(0, 1, 0));
layer.Contents.Add(new Operator.MoveTo(500, 750));
layer.Contents.Add(new Operator.LineTo(400, 750));
layer.Contents.Add(new Operator.Stroke());
page.Layers.Add(layer);
layer = new Layer("oc3", "Blue Line");
layer.Contents.Add(new Operator.SetRGBColorStroke(0, 0, 1));
layer.Contents.Add(new Operator.MoveTo(500, 800));
layer.Contents.Add(new Operator.LineTo(400, 800));
layer.Contents.Add(new Operator.Stroke());
page.Layers.Add(layer);
doc.Save("output.pdf");

==============

Feature to support to control footnote line

Example:

Document doc = new Document();
Helper.SetLicense();
Page page = doc.Pages.Add();
GraphInfo graph = new GraphInfo();
graph.LineWidth = 2;
graph.Color = Color.Red;
graph.DashArray = new int[] { 3 };
graph.DashPhase = 1;
page.NoteLineStyle = graph;
TextFragment text = new TextFragment("test text 1");
text.FootNote = new Note("foot note for test text 1");
page.Paragraphs.Add(text);
text = new TextFragment("test text 2");
text.FootNote = new Note("foot note for test text 2");
page.Paragraphs.Add(text);
doc.Save(outFile);

================

Feature to disable file compression when adding as embedded resources
Encoding property was added to FileSpecification class.
This property determines which encoding will be used for file compressing.
This property may have value of FileEncoding enumarator.
For now possible values are FileEncoding.None and FileEncoding.Zip.
If Encoding is set to FileEncoding.None then attachment is not compressed.
By default Encoding have FileEncoding.Zip value.

Example:

Document pdfDocument = new Document("input.pdf");
//setup new file to be added as attachment
FileSpecification fileSpecification = new FileSpecification("test.txt", "Sample text file");
//Specify Encoding proparty setting it to FileEncoding.None
fileSpecification.setEncoding (FileEncoding.None);
//add attachment to document's attachment collection
pdfDocument.getEmbeddedFiles().add(fileSpecification);
//save new output
pdfDocument.save("output.pdf");

================

com.aspose.pdf.facades.Form class:
Deprecated methods:
public OutputStream getDestStream()
public void setDestStream(OutputStream value)
Deprecated constructor:
public Form(InputStream srcStream, OutputStream destStream)

com.aspose.pdf.facades.PdfFileEdito class:
Added internal class:
public static class PageBreak
Added methods:
public void addPageBreak(Document src, Document dest, PageBreak[] pageBreaks)
public void addPageBreak(String src, String dest, PageBreak[] pageBreaks)

com.aspose.pdf.facades.PdfFileStamp class:
Deprecated methods:
public String getInputFile()
public void setInputFile(String value)
public InputStream getInputStream()
public void setInputStream(InputStream value)
public String getOutputFile()
public void setOutputFile(String value)
public OutputStream getOutputStream()
public void setOutputStream(OutputStream value)

com.aspose.pdf.facades.AutoFiller class:
Deprecated methods:
public OutputStream getOutputStream()
public void setOutputStream(OutputStream value)
public InputStream getInputStream()
public void setInputStream(InputStream value)

com.aspose.pdf.facades.FormEditor class:
Deprecated constructors:
public FormEditor(IDocument document, OutputStream destStream)
public FormEditor(IDocument document, String destFileName)
public FormEditor(InputStream srcStream, OutputStream destStream)

com.aspose.pdf.facades.PdfFileMend class:
Deprecated constructors:
public PdfFileMend(IDocument document, String outputFileName)

com.aspose.pdf.facades.PdfFileSecurity class:
Deprecated methods:
public void setInputStream(InputStream value)
public void setOutputStream(OutputStream value)
Deprecated constructors:
public PdfFileSecurity(InputStream inputStream, OutputStream outputStream)

com.aspose.pdf.generator.legacyxmlmodel.PathArea class:
Added method:
public java.util.Map getShapes()

com.aspose.pdf.generator.legacyxmlmodel.ShadingPattern class:
Added method:
public java.awt.Color getColor()

com.aspose.pdf.generator.legacyxmlmodel.ShadingPatternFactory class:
Added method:
public static ShadingPattern getShadingPattern(int level,java.awt.Color color)

com.aspose.pdf.Document class:
Added methods:
public boolean getAllowReusePageContent()
public void setAllowReusePageContent(boolean value)

com.aspose.pdf.Artifact class:
Added methods:
public void setImage(InputStream imageStream)

com.aspose.pdf.ArtifactCollection class:
Added methods:
public java.util.List<Artifact> findByValue(String name, String expectedValue)

com.aspose.pdf.BackgroundArtifact class:
Added methods:
public InputStream getBackgroundImage()

com.aspose.pdf.BaseParagraph class:
Added methods:
public boolean isInLineParagraph()
public void setInLineParagraph(boolean value)

com.aspose.pdf.BaseParagraph class:
Changes in methods:
public java.awt.geom.Point2D.Float getPageSize() -> public java.awt.geom.Dimension2D getPageSize()
public void setPageSize(java.awt.geom.Point2D.Float value) - > public void setPageSize(java.awt.geom.Dimension2D value)

com.aspose.pdf.CgmLoadOptions class:
Changes in methods:
public java.awt.geom.Point2D.Float getPageSize() -> public java.awt.geom.Dimension2D getPageSize()
public CgmLoadOptions(java.awt.geom.Point2D.Float pageSize) -> public CgmLoadOptions(java.awt.geom.Dimension2D pageSize)

com.aspose.pdf.Color class:
Added methods:
public PatternColorSpace getPatternColorSpace()
public void setPatternColorSpace(PatternColorSpace value)

com.aspose.pdf.ComHelper class:
Added methods:
public Document openStream(InputStream input)
public Document openStream(InputStream input, String password)
public Document openStream(InputStream input, boolean isManagedStream)
public Document openStream(InputStream input, String password, boolean isManagedStream)
public Document openStream(InputStream input, LoadOptions options)

com.aspose.pdf.ComHelper class:
Added constructors:
public ContentsAppender(XForm form)

com.aspose.pdf.ComHelper class:
Added methods:
public void setCreationDate(java.util.Date value)
public double getCreationTimeZone()
public void setCreationTimeZone(double value)
public double getModTimeZone()
public void setModTimeZone(double value)
public java.util.Date getModDate()
public void setModDate(java.util.Date value)

com.aspose.pdf.FileParams class:
Added methods:
public java.util.Date getCreationDate()
public void setCreationDate(java.util.Date value)
public java.util.Date getModDate()
public void setModDate(java.util.Date value)
Added constructor:
public FileParams(FileSpecification spec)

com.aspose.pdf.FileParams class:
Added methods:
public /*FileEncoding*/int getEncoding()
public void setEncoding(/*FileEncoding*/int value)
public void setParams(FileParams value)

com.aspose.pdf.FloatingBox class:
Changes:
public /*VerticalAlignment*/int _VerticalAlignment; ->
public /*VerticalAlignment*/int getVerticalAlignment_Rename_Namesake() and public void setVerticalAlignment_Rename_Namesake(/*VerticalAlignment*/int value)

com.aspose.pdf.IIndexBitmapConverte class:
Added methods:
public java.awt.image.BufferedImage get1BppImage(java.awt.image.BufferedImage src);
public java.awt.image.BufferedImage get4BppImage(java.awt.image.BufferedImage src);
public java.awt.image.BufferedImage get8BppImage(java.awt.image.BufferedImage src);

com.aspose.pdf.Image class:
Changes:
public /*ImageFileType*/int getFileType() -> public/* ImageFileType */int getFileType()
public void setFileType(/*ImageFileType*/int value) -> public void setFileType(/* ImageFileType */int value)
Added methods:
public boolean isBlackWhite()
public void setBlackWhite(boolean value)

com.aspose.pdf.Layer class:
Added methods:
public java.util.List<Operator> getContents()

com.aspose.pdf.LevelFormat class:
Changes:
public aspose.pdf.MarginInfo getMargin() -> public com.aspose.pdf.MarginInfo getMargin()
public void setMargin(aspose.pdf.MarginInfo value) -> public void setMargin(com.aspose.pdf.MarginInfo value)

com.aspose.pdf.Page class:
Added methods:
public GraphInfo getNoteLineStyle()
public void setNoteLineStyle(GraphInfo value)

com.aspose.pdf.Page class:
Added fields:
public boolean SupressErrors;

com.aspose.pdf.Page class:
Added constructor:
public PKCS7Detached(InputStream pfx, String password)

com.aspose.pdf.SoundData class:
Added methods:
public InputStream getContents()

com.aspose.pdf.TextExtractionOptions class:
Added methods:
public double getScaleFactor()
public void setScaleFactor(double value)

com.aspose.pdf.TextFragment class:
Added methods:
public Note getEndNote()
public void setEndNote(Note value)
public Note getFootNote()
public void setFootNote(Note value)

com.aspose.pdf.TextFragmentState class:
Added methods:
public float getCharacterSpacing()

com.aspose.pdf.TextStamp class:
Added methods:
public boolean getDraw()
public void setDraw(boolean value)

com.aspose.pdf.TextStamp class:
Added methods:
public float getCharacterSpacing()

com.aspose.pdf.TocInfo class:
Added methods:
public void setLevelIndentation(int value)
public int getLevelIndentation()

com.aspose.pdf.XImage class:
Added methods:
public boolean containsTransparency()
public /*ColorType*/int getColorType()

com.aspose.pdf.License class:
Added throws Exception to the methods setLicense:
public void setLicense(InputStream stream) throws Exception
public void setLicense(String licenseName) throws Exception

Added
newclass com.aspose.pdf.Note
Added new class com.aspose.pdf.facades.PdfPrintPageInfo

Added
newenum class com.aspose.pdf.FileEncoding


Aspose.Pdf for Java 10.1.0

$
0
0

  We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

Fixed Bugs:

PDFNEWJAVA-34483 Incorrect Rectangle values
PDFNEWJAVA-33460 Evaluation watermark not appearing when printing PDF file
PDFNEWJAVA-34637 PDF to JPEG - taking much time and memory
PDFNEWJAVA-34298 PDF to TIFF - output is garbled
PDFNEWJAVA-33457 Unable to modify FreeTextAnnotation in PDF
PDFNEWJAVA-34709 Exception when trying to add watermark
PDFNEWJAVA-33800 PdfFileMend - Image is not appearing in resultant PDF file
PDFNEWJAVA-33480 Error when using setPrintable() method
PDFNEWJAVA-34096 Memory leakage in document.save method
PDFNEWJAVA-34288 PdfViewer: Print range of pages
PDFNEWJAVA-33805 PdfViewer: Printing PDF document issue
PDFNEWJAVA-33815 Line drawn using PdfContentEditor is missing in printout
PDFNEWJAVA-34148 TIFF to PDF - Exception during conversion
PDFNEWJAVA-34368 PDF to PNG - OutOfMemory Exception is being generated
PDFNEWJAVA-34700 TIFF to PDF: pages are being rendered in blue color
PDFNEWJAVA-34697 TIFF to PDF - Color of text is being changed in PDF
PDFNEWJAVA-34251 Image to PDF: multipage Tiff image is not rendering completely
PDFNEWJAVA-34530 Password prompt when viewing document
PDFNEWJAVA-34506 aspose-pdf: Security.setUserPassword does not work after V 4.2.1
PDFNEWJAVA-33863 save asks for "execute" permission
PDFNEWJAVA-34467 SVG to PDF: Image won't be inserted


Public API and Backwards Incompatible Changes:

====
Getting total number of pages in new Generator without saving Document

Example:
Document doc = new Document();
Page page = doc.getPages().add();
for (int i = 0; i < 300; i++)
page.getParagraphs().add(new TextFragment("Pages count test"));
doc.processParagraphs();

====

Added new exception classes:
com.aspose.pdf.exceptions.UnsupportedFontTypeException
com.aspose.pdf.exceptions.InvalidFormTypeOperationException
com.aspose.pdf.exceptions.InvalidCgmFileFormatException

com.aspose.pdf.facades.PdfViewer
added methods:
public boolean getUseIntermidiateImage()
public void setUseIntermidiateImage(boolean value)

com.aspose.pdf.XForm
Added method:
public void freeMemory()

com.aspose.pdf.TextSearchOptions
Added methods:
public boolean getUseFontEngineEncoding()
public void setUseFontEngineEncoding(boolean value)

com.aspose.pdf.TextEditOptions
Added methods:
public TextEditOptions(boolean allowLanguageTransformation)
public boolean getAllowLanguageTransformation()
public void setAllowLanguageTransformation(boolean value)

com.aspose.pdf.Page
Added methods:
public void processParagraphs()
public void dispose()

com.aspose.pdf.IDocument
Added methods:
public void processParagraphs();

com.aspose.pdf.Document
Added methods:
public void processParagraphs();

com.aspose.pdf.DocSaveOptions
Added methods:
public boolean getAddReturnToLineEnd()
public void setAddReturnToLineEnd(boolean value)

com.aspose.pdf.HtmlDocumentTypeInternal class - moved.

Aspose.Pdf for Java 10.2.0

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Features:

  • PDFNEWJAVA-34406 Support PDF to PDF/A-2A conversion
  • PDFNEWJAVA-34490 After replacing the text, the contents of the PDF should be re-arranged
Fixed Bugs:

  • PDFNEWJAVA-34483 Incorrect Rectangle values
  • PDFNEWJAVA-34745 SVG to PDF: Background of path element is black instead of white
  • PDFNEWJAVA-34694 aspose.pdf package throws IllegalStateException for fonts
  • PDFNEWJAVA-34735 PDF to DOC: 10.0.0 misses text in contrast to previous versions
  • PDFNEWJAVA-34592 PDF to APS: The last symbol of underlined text is not underlined if this symbol is "s".
  • PDFNEWJAVA-34353 PDF to DOC: Underline is absent in Flow mode
  • PDFNEWJAVA-34693 PDF to PNG: some text appears on stdout
  • PDFNEWJAVA-34434 PDF to DOC - Words are not properly highlighted
  • PDFNEWJAVA-34782 PDF to Image - Exception during conversion
  • PDFNEWJAVA-34544 PDF to HTML: Text is not being rendered correctly
  • PDFNEWJAVA-34347 PDF to HTML - Conversion takes too much time
  • PDFNEWJAVA-34716 PDF to HTML - Single HTML with All Resources Embedded
  • PDFNEWJAVA-34011 UniCode text is not appearing in PDF file
  • PDFNEWJAVA-34488 Annotation Icon color issue in Aspose.Pdf for Java 9.5.0

Aspose.Pdf for Java 10.3.0

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

Enhancement:

  • PDFNEWJAVA-34617 Increase TextStamp creation performance
  • PDFNEWJAVA-34806 com.aspose.pdf.MemoryCleaner.clear() method nulls the license object as well
Fixed Bugs:

  • PDFNEWJAVA-34588 Aspose.Pdf 9.5.2 to HTML conversion issue on particular file
  • PDFNEWJAVA-34594 UTF-8 characters not appearing properly
  • PDFNEWJAVA-34816 License implementation difference in 9.3.0 and 10.2.0 with Java web application
  • PDFNEWJAVA-34641 java.awt.HeadlessException in Headless Mode
  • PDFNEWJAVA-34297 PDF to Image - Conversion process stucks in infinite loop
  • PDFNEWJAVA-34619 Text to PDF: Incorrect rendering of UTF8 text in output PDF
  • PDFNEWJAVA-34620 Text to PDF: Incorrect rendering of UTF16 text in output PDF
  • PDFNEWJAVA-34711 TextFragmentAbsorber gets wrong coordinates of seached Text
  • PDFNEWJAVA-34596 Image to PDF: API throws IllegalArgumentException
  • PDFNEWJAVA-34199 PDF to PNG - Process hangs during conversion
  • PDFNEWJAVA-34374 PDF to HTML: text is distorted in output HTML
  • PDFNEWJAVA-34655 PDF to DOC: Text renders incorrectly
  • PDFNEWJAVA-34775 Image to PDF throws IllegalArgumentException exception
  • PDFNEWJAVA-34510 PDF to HTML - StringIndexOutOfBoundsException being generated
  • PDFNEWJAVA-34793 PDF to Image - conversion method stuck and never returns
  • PDFNEWJAVA-34365 Hyperlink text/contents are not visible in PDF file

Aspose.Pdf for Java 10.4.0

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Feature:

  • PDFNEWJAVA-34093 Aspose.Pdf for Java Jar for OSGI framework
  • PDFNEWJAVA-34089 Convert mhtml to pdf

Fixed Bugs:

  • PDFNEWJAVA-34815 PDF to HTML: setting document background feature is not working properly
  • PDFNEWJAVA-34346 PDF to HTML - Text in resultant file is garbled.
  • PDFNEWJAVA-34843 After adding attachments, some random attachment are not accessable
  • PDFNEWJAVA-34887 Fast Web view issue
  • PDFNEWJAVA-34891 PDF to PDFA: Invalid PDFA file generated while overwriting same file during DOC to PDF to PDFA
  • PDFNEWJAVA-34857 PDF to HTML: Images become incorrect
  • PDFNEWJAVA-34742 Printing: Pdf to Postscript landscape not working
  • PDFNEWJAVA-34686 PDF to PDF/A - Resultant file is not compliant
  • PDFNEWJAVA-34464 XPS to PDF - incorrect converted transparency for some objects.
  • PDFNEWJAVA-34292 OutOfMemory Exception while printing the PDF file
  • PDFNEWJAVA-34351 Unable to use printDocumentWithSettings(..) method
  • PDFNEWJAVA-33673 Exception while manipulating PDF files over IBM WAS
  • PDFNEWJAVA-34739 PDF to TIFF: TiffDevice overload with TiffSetting argument not working
  • PDFNEWJAVA-34101 PDF to HTML - The image in the document is converted partially
  • PDFNEWJAVA-34141 PDF to PNG - The conversion process keeps on running. Never stops
  • PDFNEWJAVA-34607 PDF to HTML: Incorrect colors in output html
  • PDFNEWJAVA-34790 Overwriting PDF file generates output 0KB
  • PDFNEWJAVA-34750 PDF to Html throws IllegalArgumentException
  • PDFNEWJAVA-34811 PDF to PNG - Colors are changed in resultant image

Aspose.Pdf for Java 10.4.1

$
0
0

We are pleased to announce the release of latest hotfix containing resolution of some high priority issues.

Fixed Bugs:

  • PDFNEWJAVA-34938 HTML to PDF - Checkbox control overlaps text line contents
  • PDFNEWJAVA-34950 PDF to PNG - Contents are garbled in resultant file
  • PDFNEWJAVA-34547 HorizontalAlignment is not being honored for cell contents
  • PDFNEWJAVA-34732 Slight color change of transparent signature image with Aspose.Pdf for Java 10.0.0
  • PDFNEWJAVA-34093 Aspose.Pdf for Java Jar for OSGI framework
  • PDFNEWJAVA-34855 Aspose.Pdf for Java throws NullPointerException over Apache Karaf application server
  • PDFNEWJAVA-34573 PDF to XML - resultnat file contains extra spaces at the end of file
  • PDFNEWJAVA-34895 PDF to PNG - Unexpected borders around text

Aspose.Pdf for Java 10.6.0

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

New Feature:

  • PDFNEWJAVA-34429 Support PDF to PDF/A-3A conversion
  • PDFNEWJAVA-34314 Create PDF/A-3 and attach XML file
  • PDFNEWJAVA-33994 Remove tables from existing PDF file
  • PDFNEWJAVA-33729 Manipulating Tables in existing PDF document

Enhancement:

  • PDFNEWJAVA-34562 PDF to PNG: conversion performance issue
  • PDFNEWJAVA-34562 PDF to PNG: conversion performance issue

Fixed Bugs:

  • PDFNEWJAVA-34947 XPS to PDF - problem with the order of orange line and the text stamp drawing.
  • PDFNEWJAVA-34847 Problem with landscape printing setting
  • PDFNEWJAVA-34383 Problem with importing some tiff images
  • PDFNEWJAVA-34648 Polyline Annotation background issue on export to image
  • PDFNEWJAVA-34685 PDF to PDF/A - Resultant file is not compliant
  • PDFNEWJAVA-34951 PDF to PNG - Pictures are garbled in resultant file
  • PDFNEWJAVA-34196 PDF to PNG conversion never ends
  • PDFNEWJAVA-34244 PDF to PNG - Slow performance during conversion
  • PDFNEWJAVA-34769 Incorrect Arabic text being extacted
  • PDFNEWJAVA-33759 NullPointerException is being raised when loading PDF form
  • PDFNEWJAVA-34171 Exception while converting URL contents to PDF
  • PDFNEWJAVA-34825 PDF( R&R-24-Winter-2012.pdf) to HTML: Text is being positioned incorrect in header part of HTML
  • PDFNEWJAVA-34822 PDF( liten_svampen_nr7.pdf) to HTML: Text is being positioned incorrect in header part of HTML
  • PDFNEWJAVA-33865 Rendering issue of RichTextBoxfield with html contents- line break tag
  • PDFNEWJAVA-34636 Image to PDF: conversion thows IOException
  • PDFNEWJAVA-34817 PDF to HTML: Chinese symbols are not rendered correctly
  • PDFNEWJAVA-34821 PDF to HTML: Text is being positioned incorrect in header part of HTML
  • PDFNEWJAVA-34623 Exception when trying to optimize the PDF file
  • PDFNEWJAVA-34892 PDF to Doc: Extra lines in table's captions
  • PDFNEWJAVA-34623 Exception when trying to optimize the PDF file
  • PDFNEWJAVA-34892 PDF to Doc: Extra lines in table's captions
  • PDFNEWJAVA-34821 PDF to HTML: Text is being positioned incorrect in header part of HTML
  • PDFNEWJAVA-34738 PDF to PNG - Conversion process hangs

Aspose.Pdf for Java 10.6.1

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

Fixed Bugs:

  • PDFNEWJAVA-35081 Setting license using getResourceAsStream() throw stream closed exception
  • PDFNEWJAVA-35058 Too many open font files issue
  • PDFNEWJAVA-35065 PDF to Image: conversion hangs on last page(page 4)
  • PDFNEWJAVA-34504 PDF to DOC - Conversion process keeps running

Aspose.Pdf for Java 10.6.2

$
0
0

We are pleased to share a new version of Aspose.Pdf for Java with following improvements:

Enhancement:

  • PDFNEWJAVA-35108 Move all the internal resources and classes into com.aspose.pdf.internal package
Viewing all 47 articles
Browse latest View live