#Manipulate Tables in Java PDF apps
Explore tagged Tumblr posts
Text
Aspose.Newsletter August 2017: Manipulate HTML Files Programmatically within Any Type of .NET Apps & Other News
Aspose Newsletter for May 2017 has now been published that highlights all the newly supported features offered in the recent releases. It also includes information about It also includes information adding Professional Word Documents Processing capabilities in Android Applications, Aspose Android APIs are Renamed to “Android via Java” and “Android via Xamarin”, Exporting Excel File to Any Supported Format, Apply Checksum Validation on Codabar Coded Barcode in .NET Applications, AutoFit Cells in Worksheet and Set Excel Page Breaks in Cloud Apps, How to Render Microsoft Outlook VCard Contacts to MHTML and many more.
Add Professional Word Documents Processing capabilities in an Android Applications
Read, Create, Edit and Convert Word Document Formats with Aspose.Words Android APIs. Aspose.Words products family is growing! We are pleased to officially launch Aspose.Words for Android via Java – enabling Android developers to perform pro level word document manipulation tasks directly within Android Apps. Whether it is document formatting, reporting, mail merge, rendering or conversion to some other file formats – Aspose.Words processing engine is super-efficient to perform with high-fidelity. Download Free Trial
Aspose Android APIs are Renamed to “Android via Java” and “Android via Xamarin”
Aspose Android APIs are ported from their Java APIs as they are subset components that include all the important and useful features present in their native Java APIs. Aspose.Words, Aspose.Cells and Aspose.Email for Android are following this new product naming structure now (example: If users are building native Android apps using Android Studio, the right product is Aspose.Words for Android via Java and if users are using Xamarin platform, users can use Aspose.Words for Android via Xamarin, to build mobile apps).
Apply Checksum Validation on Codabar Coded Barcode in .NET Applications
Aspose.BarCode for .NET API now exposes the CodabarChecksumMode enumeration to specify the checksum mode. EnableChecksum property of the BarCodeBuilder class is needed to be set to TRUE before setting the checksum mode. Read detailed examples here
AutoFit Cells in Worksheet and Set Excel Page Breaks in Cloud Apps
Process Excel files using Aspose.Cells for Cloud – platform independent REST APIs. Developers can import an Excel file, autofit rows and columns of any worksheet and then save to any supported file format. Continue reading here
How to: Export PowerPoint Presentation to HTML in .NET and Java?
Aspose.Slides for .NET and Java now support converting a PowerPoint presentation to HTML with embedded audio and video data. Access fully functional .NET and Java code snippets here
How to: Render Microsoft Outlook VCard Contacts to MHTML?
Aspose.Email provides support for email threading and conversion of Outlook VCard contact information to MHTML within .NET and Java applications. This can be achieved with MhtFormatOptions.RenderVCardInfo enumerator while saving the message to MHTML. Access .NET and Java code snippets here for quick reference
How to: Permanently Delete Email Messages from PST File in .NET and Java Apps?
Aspose.Email for .NET and Java allows deleting emails from PST files on permanent basis that no other email recovery or forensic tools can retrieve ever. This feature comes handy in some legal matters where private and privileged messages are supposed to be removed prior to access. Check out .NET and Java source code examples for further illustration:
How to: Print Microsoft OneNote Documents From .NET Applications?
Aspose.Note for .NET 17.3 allows programmers to print OneNote documents from within their .NET applications. The Document.Print method allows sending the loaded document to default printer but users can also specify printer settings for printing the document using the PrintOptions class. View the source code here
Updates about new Product Releases
Aspose.Total for .NET - a compilation of our latest .NET products.
Aspose.Total for Java – a compilation of our latest Java products.
Aspose.Total for Android – all the latest versions of our Android APIs.
Aspose.Total for SharePoint – a compilation of our latest SharePoint products.
Aspose.Total for Reporting Services – a compilation of our latest Reporting Services products
Aspose.Total for JasperReports – The latest versions of our JasperReports products.
Aspose.Pdf for .NET 17.4.0 – Improved PDF to PDF/A conversion with added text manipulation features.
Aspose.Words for .NET 17.4 – Custom formatting of Field Results along with 12 new feature improvements.
Aspose.Imaging for Java 17.4 – Improved support of image resizing and rate control algorithm implementation.
Aspose.Words for Android via Xamarin 17.4 – Improved support of linear gradients rendering as well as reading of GIF files.
Aspose.Tasks for .NET 17.3 – Improved formula value calculations within Microsoft Project files.
Aspose.Slides for Reporting Services 17.3 – Support for working in SharePoint 2016 integration mode.
Aspose.OCR for Java 17.03 – Improved processing of skewed image to deskewed.
Aspose.Slides for Reporting Services 17.3 – Support for working in SharePoint 2016 integration mode.
Supporting User Groups and Conferences
Aspose is sponsoring a number of user groups and upcoming events, including:
May 10-12: Microsoft Build 2017 – Seattle – WA, USA
May 15-18: Visual Studio Live! Austin – Austin – TX, USA
To sponsor a user group? Get in contact at [email protected]
Collect a copy of Aspose Newsletter, August 2016 edition
Collect the English version of this newsletter
Collect the Japanese version of this newsletter
Keep in Touch
There are several ways for you to keep in touch with us. The monthly newsletter is a way for us to keep in touch with you, but we are always interested in hearing from you.
- Post a question on our forums - Follow us on Google+ - Connect with us on Post a question on our Facebook
#Java .NET File Formats APIs#Manipulate HTML Files Programmatically#develop native Android apps with Xamarin#SharePoint Server 2016 Support#Manipulate Tables in Java PDF apps#render Word document to PCL format
0 notes
Text
Hikvision Plugin Mac Os Mojave

Hikvision Microsoft Edge Plugin
Hikvision Plugin Download Internet Explorer
macOS Mojave was just dropped and for those who are early adaptors, all of our Mac plug-ins have been updated for compatibility with macOS 10.14. If you have upgraded to macOS Mojave, check out the latest version of your FileMaker plug-in.
FM Books Connector Online Edition v 2.0.5.0:Available for client or server-side deployment. Connects FileMaker with QuickBooks Online. Serial corel draw 2019.
gManipulator v 1.0.0.2: Connect FileMaker to Google, Gmail, or G Suite. Exchange data with mail, contacts, calendar, and tasks.
Address Book Manipulator v 5.0.0.1: Connect FileMaker to Apple Contacts and easily exchange data between the programs.

iCal Manipulator v 3.0.0.1: Directly connects FileMaker with Apple Calendar. Supports multiple calendars, recurring events, and tasks.
To explore the Safari User Guide, click Table of Contents at the top of the page, or enter a word or phrase in the search field. If you need more help, visit the Safari Support website. Log into your Hikvision portal and select software. Select 02 Web Components. Select the Mac OSX operating system and click download.
Mac OS X To take advantage of the newest Java VM available (1.5.0 as of this writing) and to avoid some bugs of the outdated Java 1.3.1 plugin, you have to install Java Embedding Plugin for Mac OS X (Bug 274312) Installing Address Book Palm Sync on Windows. Safari 12 no longer supports plug-ins, so that takes care of the Webvideoplugin. Can't speak to the other browser reasons. If you were referring to this product as a plug-in, and it really is a legacy Safari extension (.safariextz), then Safari 12 will not support it when provided outside of the Safari Extensions Gallery in the Mac App Store.
FM Credit Card v 2.0.0.1: Available for client and server-side deployments. Connects FileMaker to your preferred merchant services provider.
PDF Manipulator DC v 1.0.2.3:Create a searchable document management system and process forms faster by extracting and inserting data between PDF form fields and FileMaker.
File Manipulator v 5.0.0.1: Copy, move, rename, or delete files and folders directly from your FileMaker solution. Zip/unzip and encrypt/decrypt file data with password protection. https://loadingpon68.tumblr.com/post/665590484223295488/macos-10-12-sierra-final-by-techreviews-vmdk-download.
Change Printer v 5.0.0.1: Automatically change printers, set optional printing attributes, and easily switch between various types of printers/drivers.
Hikvision Microsoft Edge Plugin

Hikvision Plugin Download Internet Explorer
For additional information on product functionality, updates, and integration details, please visit our website.

0 notes
Text
The Ultimate Python Beginner's Handbook
Python has become one of the fastest-growing programming languages over the past few years.
Not only it is widely used, it is also an awesome language to tackle if you want to get into the world of programming.
This Python Guide for Beginners allows you to learn the core of the language in a matter of hours instead of weeks.
Quick info: You can download a PDF version of this Python Guide for Beginners.
Ready to dive in?
Table of contents
Introduction to Python
Installing Python 3
Running Code
Syntax
Comments
Variables
Types
Typecasting
User Input
Operators
Conditionals
Lists
Tuples
Sets
Dictionaries
while Loops
for Loops
Functions
Scope
List Comprehensions
Lambda Functions
Modules
if name == 'main'
Files
Classes and Objects
Inheritance
Exceptions
Conclusion
Introduction to Python
Python was created in 1990 by Guido Van Rossum in Holland.
One of the objectives of the language was to be accessible to non-programmers.
Python was also designed to be a second language for programmers to learn due to its low learning curve and ease of use.
Python runs on Mac, Linux, Windows, and many other platforms.
Python is:
Interpreted: it can execute at runtime, and changes in a program are instantly perceptible. To be very technical, Python has a compiler. The difference when compared to Java or C++ is how transparent and automatic it is. With Python, we don't have to worry about the compilation step as it's done in real-time. The tradeoff is that interpreted languages are usually slower than compiled ones.
Semantically Dynamic: you don't have to specify types for variables and there is nothing that makes you do it.
Object-Oriented: everything in Python is an object. But you can choose to write code in an object-oriented, procedural, or even functional way.
High level: you don't have to deal with low-level machine details.
Python has been growing a lot recently partly because of its many uses in the following areas:
System scripting: it's a great tool to automate everyday repetitive tasks.
Data Analysis: it is a great language to experiment with and has tons of libraries and tools to handle data, create models, visualize results and even deploy solutions. This is used in areas like Finance, E-commerce, and Research.
Web Development: frameworks like Django and Flask allow the development of web applications, API's, and websites.
Machine Learning: Tensorflow and Pytorch are some of the libraries that allow scientists and the industry to develop and deploy Artificial Intelligence solutions in Image Recognition, Health, Self-driving cars, and many other fields.
You can easily organize your code in modules and reuse them or share them with others.
Finally, we have to keep in mind that Python had breaking changes between versions 2 and 3. And since Python 2 support ended in 2020, this article is solely based on Python 3.
So let's get started.
Installing Python 3
If you use a Mac or Linux you already have Python installed. But Windows doesn't come with Python installed by default.
You also might have Python 2, and we are going to use Python 3. So you should check to see if you have Python 3 first.
Type the following in your terminal.
python3 -V
Notice the uppercase V.
If your result is something similar to 'Python 3.x.y', for instance, Python 3.8.1, then you are ready to go.
If not, follow the next instructions according to your Operating System.
Installing Python 3 on Windows
Go to https://www.python.org/downloads/.
Download the latest version.
After the download, double-click the installer.
On the first screen, check the box indicating to "Add Python 3.x to PATH" and then click on "Install Now".
Wait for the installation process to finish until the next screen with the message "Setup was successful".
Click on "Close".
Installing Python 3 on Mac
Install XCode from the App Store.
Install the command line tools by running the following in your terminal.
xcode-select --install
I recommend using Homebrew. Go to https://brew.sh/ and follow the instructions on the first page to install it.
After installing Homebrew, run the following brew commands to install Python 3.
brew update brew install python3
Homebrew already adds Python 3 to the PATH, so you don't have to do anything else.
Installing Python 3 on Linux
To install using apt, available in Ubuntu and Debian, enter the following:
sudo apt install python3
To install using yum, available in RedHat and CentOS, enter the following:
sudo yum install python3
Running Code
You can run Python code directly in the terminal as commands or you can save the code in a file with the .py extension and run the Python file.
Terminal
Running commands directly in the terminal is recommended when you want to run something simple.
Open the command line and type python3
renan@mypc:~$ python3
You should see something like this in your terminal indicating the version (in my case, Python 3.6.9), the operating system (I'm using Linux), and some basic commands to help you.
The >>> tells us we are in the Python console.
Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
Let's test it by running our first program to perform basic math and add two numbers.
>>> 2 + 2
The output is:
4
To exit the Python console simply type exit().
>>> exit()
Running .py files
If you have a complex program, with many lines of code, the Python console isn't the best option.
The alternative is simply to open a text editor, type the code, and save the file with a .py extension.
Let's do that, create a file called second_program.py with the following content.
print('Second Program')
The print() function prints a message on the screen.
The message goes inside the parentheses with either single quotes or double quotes, both work the same.
To run the program, on your terminal do the following:
renan@mypc:~$ python3 second_program.py
The output is:
Second Program
Syntax
Python is known for its clean syntax.
The language avoids using unnecessary characters to indicate some specificity.
Semicolons
Python doesn't use semicolons to finish lines. A new line is enough to tell the interpreter that a new command is beginning.
The print() method will display something.
In this example, we have two commands that will display the messages inside the single quotes.
print('First command') print('Second command')
Output:
First command Second command
But the following is wrong due to the semicolons in the end:
print('First command'); print('Second command');
Indentation
Many languages use curly-brackets to define scope.
Python's interpreter uses only indentation to define when a scope ends and another one starts.
This means you have to be aware of white spaces at the beginning of each line -- they have meaning and might break your code if misplaced.
This definition of a function works:
def my_function(): print('First command')
This doesn't work because the indentation of the second line is missing and will throw an error:
def my_function(): print('First command')
Case sensitivity and variables
Python is case sensitive. So the variables name and Name are not the same thing and store different values.
name = 'Renan' Name = 'Moura'
As you can see, variables are easily created by just assigning values to them using the = symbol.
This means name stores 'Renan' and Name stores 'Moura'.
Finally, to comment something in your code, use the hash mark #.
The commented part does not influence the program flow.
# this function prints something def my_function(): print('First command')
This was just an overview. The details of each of these will become clearer in the next chapters with examples and broader explanations.
The purpose of comments is to explain what is happening in the code.
Comments are written along with your code but do not influence your program flow.
When you work by yourself, maybe comments don't feel like something you should write. After all, at the moment, you know the whys of every single line of code.
But what if new people come on board your project after a year and the project has 3 modules, each with 10,000 lines of code?
Think about people who don't know a thing about your app and who are suddenly having to maintain it, fix it, or add new features.
Remember, there is no single solution for a given problem. Your way of solving things is yours and yours only. If you ask 10 people to solve the same problem, they will come up with 10 different solutions.
If you want others to fully understand your reasoning, good code design is mandatory, but comments are an integral part of any codebase.
The syntax of comments in Python is rather easy: just use the hash mark # symbol in front of the text you want to be a comment.
#This is a comment and it won't influence my program flow
You can use a comment to explain what some piece of code does.
#calculates the sum of any given two numbers a + b
Maybe you want to comment on something very complex or describe how some process works in your code.
In these cases, you can use multiline comments.
To do that, just use a single hash mark # for each line.
#Everything after the hash mark # is a comment #This is a comment and it won't influence my program flow #Calculates the cost of the project given variables a and b #a is the time in months it will take until the project is finished #b is how much money it will cost per month a + b * 10
Variables
In any program, you need to store and manipulate data to create a flow or some specific logic.
That's what variables are for.
You can have a variable to store a name, another one to store the age of a person, or even use a more complex type to store all of this at once like a dictionary.
Creating, also known as Declaring
Declaring a variable is a basic and straightforward operation in Python
Just pick a name and attribute a value to it using the = symbol.
name='Bob' age=32
You can use the print() function to show the value of a variable.
print(name) print(age)
Bob 32
Notice that in Python there is no special word to declare a variable.
The moment you assign a value, the variable is created in memory.
Python also has dynamic typing, which means you don't have to tell it if your variable is a text or a number, for instance.
The interpreter infers the typing based on the value assigned.
If you need it, you can also re-declare a variable just by changing its value.
#declaring name as a string name='Bob' #re-declaring name as an int name = 32
Keep in my mind, though, that this is not recommended since variables must have meaning and context.
If I have a variable called name I don't expect it to have a number stored in it.
Naming Conventions
Let's continue from the last section when I talked about meaning and context.
Don't use random variable names like x or y.
Say you want to store the time of a party, just call it party_time.
Oh, did you notice the underscore _?
By convention, if you want to use a variable name that is composed of two or more words, you separate them by underscores. This is called Snake Case.
Another option would be using CamelCase as in partyTime. This is very common in other languages, but not the convention in Python as stated before.
Variables are case sensitive, so party_time and Party_time are not the same. Also, keep in mind that the convention tells us to always use lower case.
Remember, use names that you can recall inside your program easily. Bad naming can cost you a lot of time and cause annoying bugs.
In summary, variable names:
Are Case sensitive: time and TIME are not the same
Have to start with an underscore _ or a letter (DO NOT start with a number)
Are allowed to have only numbers, letters and underscores. No special characters like: #, $, &, @, etc.
This, for instance, is not allowed: party#time, 10partytime.
Types
To store data in Python you need to use a variable. And every variable has its type depending on the value of the data stored.
Python has dynamic typing, which means you don't have to explicitly declare the type of your variable -- but if you want to, you can.
Lists, Tuples, Sets, and Dictionaries are all data types and have dedicated sections later on with more details, but we'll look at them briefly here.
This way I can show you the most important aspects and operations of each one in their own section while keeping this section more concise and focused on giving you a broad view of the main data types in Python.
Determining the Type
First of all, let's learn how to determine the data type.
Just use the type() function and pass the variable of your choice as an argument, like the example below.
print(type(my_variable))
Boolean
The boolean type is one of the most basic types of programming.
A boolean type variable can only represent either True or False.
my_bool = True print(type(my_bool)) my_bool = bool(1024) print(type(my_bool))
<class 'bool'> <class 'bool'>
Numbers
There are three types of numeric types: int, float, and complex.
Integer
my_int = 32 print(type(my_int)) my_int = int(32) print(type(my_int))
<class 'int'> <class 'int'>
Float
my_float = 32.85 print(type(my_float)) my_float = float(32.85) print(type(my_float))
<class 'float'> <class 'float'>
Complex
my_complex_number = 32+4j print(type(my_complex_number)) my_complex_number = complex(32+4j) print(type(my_complex_number))
<class 'complex'> <class 'complex'>
String
The text type is one of the most commons types out there and is often called string or, in Python, just str.
my_city = "New York" print(type(my_city)) #Single quotes have exactly #the same use as double quotes my_city = 'New York' print(type(my_city)) #Setting the variable type explicitly my_city = str("New York") print(type(my_city))
<class 'str'> <class 'str'> <class 'str'>
You can use the + operator to concatenate strings.
Concatenation is when you have two or more strings and you want to join them into one.
word1 = 'New ' word2 = 'York' print(word1 + word2)
New York
The string type has many built-in methods that let us manipulate them. I will demonstrate how some of these methods work.
The len() function returns the length of a string.
print(len('New York'))
8
The replace() method replaces a part of the string with another. As an example, let's replace 'New' for 'Old'.
print('New York'.replace('New', 'Old'))
Old York
The upper() method will return all characters as uppercase.
print('New York'.upper())
NEW YORK
The lower() method does the opposite, and returns all characters as lowercase.
print('New York'.lower())
new york
Lists
A list has its items ordered and you can add the same item as many times as you want. An important detail is that lists are mutable.
Mutability means you can change a list after its creation by adding items, removing them, or even just changing their values. These operations will be demonstrated later in the section dedicated to Lists.
my_list = ["bmw", "ferrari", "maclaren"] print(type(my_list)) my_list = list(("bmw", "ferrari", "maclaren")) print(type(my_list))
<class 'list'> <class 'list'>
Tuples
A tuple is just like a list: ordered, and allows repetition of items.
There is just one difference: a tuple is immutable.
Immutability means you can't change a tuple after its creation. If you try to add an item or update one, for instance, the Python intepreter will show you an error. I will show that these errors occur later in the section dedicated to Tuples.
my_tuple = ("bmw", "ferrari", "maclaren") print(type(my_tuple)) my_tuple = tuple(("bmw", "ferrari", "maclaren")) print(type(my_tuple))
<class 'tuple'> <class 'tuple'>
Sets
Sets don't guarantee the order of the items and are not indexed.
A key point when using sets: they don't allow repetition of an item.
my_set = {"bmw", "ferrari", "maclaren"} print(type(my_set)) my_set = set(("bmw", "ferrari", "maclaren")) print(type(my_set))
<class 'set'> <class 'set'>
Dictionaries
A dictionary doesn't guarantee the order of the elements and is mutable.
One important characteristic in dictionaries is that you can set your own access keys for each element.
my_dict = {"country" : "France", "worldcups" : 2} print(type(my_dict)) my_dict = dict(country="France", worldcups=2) print(type(my_dict))
<class 'dict'> <class 'dict'>
Typecasting
Typecasting allows you to convert between different types.
This way you can have an int turned into a str, or a float turned into an int, for instance.
Explicit conversion
To cast a variable to a string just use the str() function.
# this is just a regular explicit intialization my_str = str('32') print(my_str) # int to str my_str = str(32) print(my_str) # float to str my_str = str(32.0) print(my_str)
32 32 32.0
To cast a variable to an integer just use the int() function.
# this is just a regular explicit intialization my_int = int(32) print(my_int) # float to int: rounds down to 3 my_int = int(3.2) print(my_int) # str to int my_int = int('32') print(my_int)
32 3 32
To cast a variable to a float just use the float() function.
# this is an explicit intialization my_float = float(3.2) print(my_float) # int to float my_float = float(32) print(my_float) # str to float my_float = float('32') print(my_float)
3.2 32.0 32.0
What I did above is called an explicit type conversion.
In some cases you don't need to do the conversion explicitly, since Python can do it by itself.
Implicit conversion
The example below shows implicit conversion when adding an int and a float.
Notice that my_sum is float. Python uses float to avoid data loss since the int type can not represent the decimal digits.
my_int = 32 my_float = 3.2 my_sum = my_int + my_float print(my_sum) print(type(my_sum))
35.2 <class 'float'>
On the other hand, in this example, when you add an int and a str, Python will not be able to make the implicit conversion, and the explicit type conversion is necessary.
my_int = 32 my_str = '32' # explicit conversion works my_sum = my_int + int(my_str) print(my_sum) #implicit conversion throws an error my_sum = my_int + my_str
64 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'int' and 'str'
The same error is thrown when trying to add float and str types without making an explicit conversion.
my_float = 3.2 my_str = '32' # explicit conversion works my_sum = my_float + float(my_str) print(my_sum) #implicit conversion throws an error my_sum = my_float + my_str
35.2 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'float' and 'str'
User Input
If you need to interact with a user when running your program in the command line (for example, to ask for a piece of information), you can use the input() function.
country = input("What is your country? ") #user enters 'Brazil' print(country)
Brazil
The captured value is always string. Just remember that you might need to convert it using typecasting.
age = input("How old are you? ") #user enters '29' print(age) print(type(age)) age = int(age) print(type(age))
The output for each print() is:
29 <class 'str'> <class 'int'>
Notice the age 29 is captured as string and then converted explicitly to int.
Operators
In a programming language, operators are special symbols that you can apply to your variables and values in order to perform operations such as arithmetic/mathematical and comparison.
Python has lots of operators that you can apply to your variables and I will demonstrate the most used ones.
Arithmetic Operators
Arithmetic operators are the most common type of operators and also the most recognizable ones.
They allow you to perform simple mathematical operations.
They are:
+: Addition
-: Subtraction
*: Multiplication
/: Division
**: Exponentiation
//: Floor Division, rounds down the result of a division
%: Modulus, gives you the remainder of a division
Let's see a program that shows how each of them is used.
print('Addition:', 5 + 2) print('Subtraction:', 5 - 2) print('Multiplication:', 5 * 2) print('Division:', 5 / 2) print('Floor Division:', 5 // 2) print('Exponentiation:', 5 ** 2) print('Modulus:', 5 % 2)
Addition: 7 Subtraction: 3 Multiplication: 10 Division: 2.5 Floor Division: 2 Exponentiation: 25 Modulus: 1
Concatenation
Concatenation is when you have two or more strings and you want to join them into one.
This useful when you have information in multiple variables and want to combine them.
For instance, in this next example I combine two variables that contain my first name and my last name respectively to have my full name.
The + operator is also used to concatenate.
first_name = 'Renan ' last_name = 'Moura' print(first_name + last_name)
Renan Moura
Since concatenation is applied to strings, to concatenate strings with other types, you have to do an explicit typecast using str().
I have to typecast the int value 30 to string with str() to concatenate it with the rest of the string.
age = 'I have ' + str(30) + ' years old' print(age)
I have 30 years old
Comparison Operators
Use comparison operators to compare two values.
These operators return either True or False.
They are:
==: Equal
!=: Not equal
>: Greater than
<: Less than
>=: Greater than or equal to
<=: Less than or equal to
Let's see a program that shows how each of them is used.
print('Equal:', 5 == 2) print('Not equal:', 5 != 2) print('Greater than:', 5 > 2) print('Less than:', 5 < 2) print('Greater than or equal to:', 5 >= 2) print('Less than or equal to:', 5 <= 2)
Equal: False Not equal: True Greater than: True Less than: False Greater than or equal to: True Less than or equal to: False
Assignment Operators
As the name implies, these operators are used to assign values to variables.
x = 7 in the first example is a direct assignment storing the number 7 in the variable x.
The assignment operation takes the value on the right and assigns it to the variable on the left.
The other operators are simple shorthands for the Arithmetic Operators.
In the second example x starts with 7 and x += 2 is just another way to write x = x + 2. This means the previous value of x is added by 2 and reassigned to x that is now equal to 9.
x = 7 print(x)
7
+=: addition and assignment
x = 7 x += 2 print(x)
9
-=: subtraction and assignment
x = 7 x -= 2 print(x)
5
*=: multiplication and assignment
x = 7 x *= 2 print(x)
14
/=: division and assignment
x = 7 x /= 2 print(x)
3.5
%=: modulus and assignment
x = 7 x %= 2 print(x)
1
//=: floor division and assignment
x = 7 x //= 2 print(x)
3
**=: exponentiation and assignment
x = 7 x **= 2 print(x)
49
Logical Operators
Logical operators are used to combine statements applying boolean algebra.
They are:
and: True only when both statements are true
or: False only when both x and y are false
not: The not operator simply inverts the input, True becomes False and vice versa.
Let's see a program that shows how each one is used.
x = 5 y = 2 print(x == 5 and y > 3) print(x == 5 or y > 3) print(not (x == 5))
False True False
Membership Operators
These operators provide an easy way to check if a certain object is present in a sequence: string, list, tuple, set, and dictionary.
They are:
in: returns True if the object is present
not in: returns True if the object is not present
Let's see a program that shows how each one is used.
number_list = [1, 2, 4, 5, 6] print( 1 in number_list) print( 5 not in number_list) print( 3 not in number_list)
True False True
Conditionals
Conditionals are one of the cornerstones of any programming language.
They allow you to control the program flow according to specific conditions you can check.
The if statement
The way you implement a conditional is through the if statement.
The general form of an if statement is:
if expression: statement
The expression contains some logic that returns a boolean, and the statement is executed only if the return is True.
A simple example:
bob_age = 32 sarah_age = 29 if bob_age > sarah_age: print('Bob is older than Sarah')
Bob is older than Sarah
We have two variables indicating the ages of Bob and Sarah. The condition in plain English says "if Bob's age is greater than Sarah's age, then print the phrase 'Bob is older than Sarah'".
Since the condition returns True, the phrase will be printed on the console.
The if else and elif statements
In our last example, the program only does something if the condition returns True.
But we also want it to do something if it returns False or even check a second or third condition if the first one wasn't met.
In this example, we swapped Bob's and Sarah's age. The first condition will return False since Sarah is older now, and then the program will print the phrase after the else instead.
bob_age = 29 sarah_age = 32 if bob_age > sarah_age: print('Bob is older than Sarah') else: print('Bob is younger than Sarah')
Bob is younger than Sarah
Now, consider the example below with the elif.
bob_age = 32 sarah_age = 32 if bob_age > sarah_age: print('Bob is older than Sarah') elif bob_age == sarah_age: print('Bob and Sarah have the same age') else: print('Bob is younger than Sarah')
Bob and Sarah have the same age
The purpose of the elif is to provide a new condition to be checked before the else is executed.
Once again we changed their ages and now both are 32 years old.
As such, the condition in the elif is met. Since both have the same age the program will print "Bob and Sarah have the same age".
Notice you can have as many elifs as you want, just put them in sequence.
bob_age = 32 sarah_age = 32 if bob_age > sarah_age: print('Bob is older than Sarah') elif bob_age < sarah_age: print('Bob is younger than Sarah') elif bob_age == sarah_age: print('Bob and Sarah have the same age') else: print('This one is never executed')
Bob and Sarah have the same age
In this example, the else is never executed because all the possibilities are covered in the previous conditions and thus could be removed.
Nested conditionals
You might need to check more than one conditional for something to happen.
In this case, you can nest your if statements.
For instance, the second phrase "Bob is the oldest" is printed only if both ifs pass.
bob_age = 32 sarah_age = 28 mary_age = 25 if bob_age > sarah_age: print('Bob is older than Sarah') if bob_age > mary_age: print('Bob is the oldest')
Bob is the oldest
Or, depending on the logic, make it simpler with Boolean Algebra.
This way, your code is smaller, more readable and easier to maintain.
bob_age = 32 sarah_age = 28 mary_age = 25 if bob_age > sarah_age and bob_age > mary_age: print('Bob is the oldest')
Bob is the oldest
Or even:
bob_age = 32 sarah_age = 28 mary_age = 25 if bob_age > sarah_age > mary_age: print('Bob is the oldest')
Bob is the oldest
Ternary Operators
The ternary operator is a one-line if statement.
It's very handy for simple conditions.
This is how it looks:
<expression> if <condition> else <expression>
Consider the following Python code:
a = 25 b = 50 x = 0 y = 1 result = x if a > b else y print(result)
1
Here we use four variables, a and b are for the condition, while x and y represent the expressions.
a and b are the values we are checking against each other to evaluate some condition. In this case, we are checking if a is greater than b.
If the expression holds true, i.e., a is greater than b, then the value of x will be attributed to result which will be equal to 0.
However, if a is less than b, then we have the value of y assigned to result, and result will hold the value 1.
Since a is less than b, 25 < 50, result will have 1 as final value from y.
The easy way to remember how the condition is evaluated is to read it in plain English.
Our example would read: result will be x if a is greater than b otherwise y.
Lists
As promised in the Types section, this section and the next three about Tuples, Sets, and Dictionaries will have more in depth explanations of each of them since they are very important and broadly used structures in Python to organize and deal with data.
A list has its items ordered and you can add the same item as many times as you want.
An important detail is that lists are mutable.
Mutability means you can change a list after its creation by adding items, removing them, or even just changing their values.
Initialization
Empty List
people = []
List with initial values
people = ['Bob', 'Mary']
Adding in a List
To add an item in the end of a list, use append().
people = ['Bob', 'Mary'] people.append('Sarah') print(people)
['Bob', 'Mary', 'Sarah']
To specify the position for the new item, use the insert() method.
people = ['Bob', 'Mary'] people.insert(0, 'Sarah') print(people)
['Sarah', 'Bob', 'Mary']
Updating in a List
Specify the position of the item to update and set the new value
people = ['Bob', 'Mary'] people[1] = 'Sarah' print(people)
['Bob', 'Sarah']
Deleting in a List
Use the remove() method to delete the item given as an argument.
people = ['Bob', 'Mary'] people.remove('Bob') print(people)
['Mary']
To delete everybody, use the clear() method:
people = ['Bob', 'Mary'] people.clear()
Retrieving in a List
Use the index to reference the item.
Remember that the index starts at 0.
So to access the second item use the index 1.
people = ['Bob', 'Mary'] print(people[1])
Mary
Check if a given item already exists in a List
people = ['Bob', 'Mary'] if 'Bob' in people: print('Bob exists!') else: print('There is no Bob!')
Tuples
A tuple is similar to a list: it's ordered, and allows repetition of items.
There is just one difference: a tuple is immutable.
Immutability, if you remember, means you can't change a tuple after its creation. If you try to add an item or update one, for instance, the Python interpreter will show you an error.
Initialization
Empty Tuple
people = ()
Tuple with initial values
people = ('Bob', 'Mary')
Adding in a Tuple
Tuples are immutable. This means that if you try to add an item, you will see an error.
people = ('Bob', 'Mary') people[2] = 'Sarah'
Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'tuple' object does not support item assignment
Updating in a Tuple
Updating an item will also return an error.
But there is a trick: you can convert into a list, change the item, and then convert it back to a tuple.
people = ('Bob', 'Mary') people_list = list(people) people_list[1] = 'Sarah' people = tuple(people_list) print(people)
('Bob', 'Sarah')
Deleting in a Tuple
For the same reason you can't add an item, you also can't delete an item, since they are immutable.
Retrieving in a Tuple
Use the index to reference the item.
people = ('Bob', 'Mary') print(people[1])
Mary
Check if a given item already exists in a Tuple
people = ('Bob', 'Mary') if 'Bob' in people: print('Bob exists!') else: print('There is no Bob!')
Sets
Sets don't guarantee the order of items and are not indexed.
A key point when using sets: they don't allow repetition of an item.
Initialization
Empty Set
people = set()
Set with initial values
people = {'Bob', 'Mary'}
Adding in a Set
Use the add() method to add one item.
people.add('Sarah')
Use the update() method to add multiple items at once.
people.update(['Carol', 'Susan'])
Remember, Sets do not allow repetition, so if you add 'Mary' again, nothing changes.
people = {'Bob', 'Mary'} people.add('Mary') print(people)
{'Bob', 'Mary'}
Updating in a Set
Items in a set are not mutable. You have to either add or delete an item.
Deleting in a Set
To remove Bob from the dictionary:
people = {'Bob', 'Mary'} people.remove('Bob') print(people)
{'Mary'}
To delete everybody:
people.clear()
Check if a given item already exists in a set
people = {'Bob', 'Mary'} if 'Bob' in people: print('Bob exists!') else: print('There is no Bob!')
Dictionaries
The dictionary doesn't guarantee the order of the elements and it is mutable.
One important characteristic of dictionaries is that you can set your customized access keys for each element.
Initialization of a Dictionary
Empty Dictionary
people = {}
Dictionary with initial values
people = {'Bob':30, 'Mary':25}
Adding in a Dictionary
If the key doesn't exist yet, it is appended to the dictionary.
people['Sarah']=32
Updating a Dictionary
If the key already exists, the value is just updated.
#Bob's age is 28 now people['Bob']=28
Notice that the code is pretty much the same.
Deleting in a Dictionary
To remove Bob from the dictionary:
people.pop('Bob')
To delete everybody:
people.clear()
Retrieving in a Dictionary
bob_age = people['Bob'] print(bob_age)
30
Check if a given key already exists in a Dictionary
if 'Bob' in people: print('Bob exists!') else: print('There is no Bob!')
while Loops
Loops are used when you need to repeat a block of code a certain number of times or apply the same logic over each item in a collection.
There are two types of loops: for and while.
You will learn about for loops in the next section.
Basic Syntax
The basic syntax of a while loop is as below.
while condition: statement
The loop will continue until the condition is True.
The square of a number is
The example below takes each value of number and calculates its squared value.
number = 1 while number <= 5: print(number, 'squared is', number**2) number = number + 1
1 squared is 1 2 squared is 4 3 squared is 9 4 squared is 16 5 squared is 25
You can use any variable name, but I chose number because it makes sense in the context. A common generic choice would be simply i.
The loop will go on until number (initialized with 1) is less than or equal to 5.
Notice that after the print() command, the variable number is incremented by 1 to take the next value.
If you don't do the incrementation you will have an infinite loop since number will never reach a value greater than 5. This is a very important detail!
else block
When the condition returns False, the else block will be called.
number = 1 while number <= 5: print(number, 'squared is', number**2) number = number + 1 else: print('No numbers left!')
1 squared is 1 2 squared is 4 3 squared is 9 4 squared is 16 5 squared is 25 No numbers left!
Notice the phrase 'No numbers left!' is printed after the loop ends, that is after the condition number <= 5 evaluates to False.
How to break out of a while loop in Python
Simply use the break keyword, and the loop will stop its execution.
number = 1 while number <= 5: print(number, 'squared is', number**2) number = number + 1 if number == 4: break
1 squared is 1 2 squared is 4 3 squared is 9
The loop runs normally, and when number reaches 4 the if statement evaluates to True and the break command is called. This finishes the loop before the squared value of the numbers 4 and 5 are calculated.
How to skip an item in a while loop
The continue will do that for you.
I had to invert the order of the if statement and the print() to show how it works properly.
number = 0 while number < 5: number = number + 1 if number == 4: continue print(number, 'squared is', number**2)
1 squared is 1 2 squared is 4 3 squared is 9 5 squared is 25
The program always checks if 4 is the current value of number. If it is, the square of 4 won't be calculated and the continue will skip to the next iteration when the value of number is 5.
for Loops
for loops are similar to while loops in the sense that they are used to repeat blocks of code.
The most important difference is that you can easily iterate over sequential types.
Basic Syntax
The basic syntax of a for loop is as below.
for item in collection: statement
Loop over a list
To loop over a list or any other collection, just proceed as shown in the example below.
cars = ['BMW', 'Ferrari', 'McLaren'] for car in cars: print(car)
BMW Ferrari McLaren
The list of cars contains three items. The for loop will iterate over the list and store each item in the car variable, and then execute a statement, in this case print(car), to print each car in the console.
range() function
The range function is widely used in for loops because it gives you a simple way to list numbers.
This code will loop through the numbers 0 to 5 and print each of them.
for number in range(5): print(number)
0 1 2 3 4
In contrast, without the range() function, we would do something like this.
numbers = [0, 1, 2, 3, 4] for number in numbers: print(number)
0 1 2 3 4
You can also define a start and stop using range().
Here we are starting in 5 and a stoping in 10. The number you set to stop is not included.
for number in range(5, 10): print(number)
5 6 7 8 9
Finally, it is also possible to set a step.
Here we starting in 10 and incrementing by 2 until 20, since 20 is the stop, it is not included.
for number in range(10, 20, 2): print(number)
10 12 14 16 18
else block
When the items in the list are over, the else block will be called.
cars = ['BMW', 'Ferrari', 'McLaren'] for car in cars: print(car) else: print('No cars left!')
BMW Ferrari McLaren No cars left!
How to break out of a for loop in Python
Simply use the break keyword, and the loop will stop its execution.
cars = ['BMW', 'Ferrari', 'McLaren'] for car in cars: print(car) if car == 'Ferrari': break
BMW Ferrari
The loop will iterate through the list and print each car.
In this case, after the loop reaches 'Ferrari', the break is called and 'McLaren' won't be printed.
How to skip an item in a for loop
In this section, we'll learn how continue can do this for you.
I had to invert the order of the if statement and the continue to show how it works properly.
Notice that I always check if 'Ferrari' is the current item. If it is, 'Ferrari' won't be printed, and the continue will skip to the next item 'McLaren'.
cars = ['BMW', 'Ferrari', 'McLaren'] for car in cars: if car == 'Ferrari': continue print(car)
BMW McLaren
Loop over a Loop: Nested Loops
Sometimes you have more complex collections, like a list of lists.
To iterate over these lists, you need nested for loops.
In this case, I have three lists: one of BMW models, another on Ferrari models, and finally one with McLaren models.
The first loop iterates over each brand's list, and the second will iterate over the models of each brand.
car_models = [ ['BMW I8', 'BMW X3', 'BMW X1'], ['Ferrari 812', 'Ferrari F8', 'Ferrari GTC4'], ['McLaren 570S', 'McLaren 570GT', 'McLaren 720S'] ] for brand in car_models: for model in brand: print(model)
BMW I8 BMW X3 BMW X1 Ferrari 812 Ferrari F8 Ferrari GTC4 McLaren 570S McLaren 570GT McLaren 720S
Loop over other Data Structures
The same logic that applies for loops over a list can be extended to the other data structures: tuple, set, and dictionary.
I will briefly demonstrate how to make a basic loop over each one of them.
Loop over a Tuple
people = ('Bob', 'Mary') for person in people: print(person)
Bob Mary
Loop over a Set
people = {'Bob', 'Mary'} for person in people: print(person)
Bob Mary
Loop over a Dictionary
To print the keys:
people = {'Bob':30, 'Mary':25} for person in people: print(person)
Bob Mary
To print the values:
people = {'Bob':30, 'Mary':25} for person in people: print(people[person])
30 25
Functions
As the code grows the complexity also grows. And functions help organize the code.
Functions are a handy way to create blocks of code that you can reuse.
Definition and Calling
In Python use the def keyword to define a function.
Give it a name and use parentheses to inform 0 or more arguments.
In the line after the declaration starts, remember to indent the block of code.
Here is an example of a function called print_first_function() that only prints a phrase 'My first function!'.
To call the function just use its name as defined.
def print_first_function(): print('My first function!') print_first_function()
My first function!
return a value
Use the return keyword to return a value from the function.
In this example the function second_function() returns the string 'My second function!'.
Notice that print() is a built-in function and our function is called from inside it.
The string returned by second_function() is passed as an argument to the print() function.
def second_function(): return 'My second function!' print(second_function())
My second function!
return multiple values
Functions can also return multiple values at once.
return_numbers() returns two values simultaneously.
def return_numbers(): return 10, 2 print(return_numbers())
(10, 2)
Arguments
You can define parameters between the parentheses.
When calling a function with parameters you have to pass arguments according to the parameters defined.
The past examples had no parameters, so there was no need for arguments. The parentheses remained empty when the functions were called.
One Argument
To specify one parameter, just define it inside the parentheses.
In this example, the function my_number expects one number as argument defined by the parameter num.
The value of the argument is then accessible inside the function to be used.
def my_number(num): return 'My number is: ' + str(num) print(my_number(10))
My number is: 10
Two or more Arguments
To define more parameters, just use a comma to separate them.
Here we have a function that adds two numbers called add. It expects two arguments defined by first_num and second_num.
The arguments are added by the + operator and the result is then returned by the return.
def add(first_num, second_num): return first_num + second_num print(add(10,2))
12
This example is very similar to the last one. The only difference is that we have 3 parameters instead of 2.
def add(first_num, second_num, third_num): return first_num + second_num + third_num print(add(10,2,3))
15
This logic of defining parameters and passing arguments is the same for any number of parameters.
It is important to point out that the arguments have to be passed in the same order that the parameters are defined.
Default value.
You can set a default value for a parameter if no argument is given using the = operator and a value of choice.
In this function, if no argument is given, the number 30 is assumed as the expected value by default.
def my_number(my_number = 30): return 'My number is: ' + str(my_number) print(my_number(10)) print(my_number())
My number is: 10 My number is: 30
Keyword or Named Arguments
When calling a function, the order of the arguments have to match the order of the parameters.
The alternative is if you use keyword or named arguments.
Set the arguments to their respective parameters directly using the name of the parameters and the = operators.
This example flips the arguments, but the function works as expected because I tell it which value goes to which parameter by name.
def my_numbers(first_number, second_number): return 'The numbers are: ' + str(first_number) + ' and ' + str(second_number) print(my_numbers(second_number=30, first_number=10))
The numbers are: 10 and 30
Any number of arguments: *args
If you don't want to specify the number of parameters, just use the * before the parameter name. Then the function will take as many arguments as necessary.
The parameter name could be anything like *numbers, but there is a convention in Python to use *args for this definition of a variable number of arguments.
def my_numbers(*args): for arg in args: print(number) my_numbers(10,2,3)
10 2 3
Any number of Keyword/Named arguments: **kwargs
Similar to *args, we can use **kwargs to pass as many keyword arguments as we want, as long as we use **.
Again, the name could be anything like **numbers, but **kwargs is a convention.
def my_numbers(**kwargs): for key, value in kwargs.items(): print(key) print(value) my_numbers(first_number=30, second_number=10)
first_number 30 second_number 10
Other types as arguments
The past examples used mainly numbers, but you can pass any type as argument and they will be treated as such inside the function.
This example takes strings as arguments.
def my_sport(sport): print('I like ' + sport) my_sport('football') my_sport('swimming')
I like football I like swimming
This function takes a list as argument.
def my_numbers(numbers): for number in numbers: print(number) my_numbers([30, 10, 64, 92, 105])
30 10 64 92 105
Scope
The place where a variable is created defines its availability to be accessed and manipulated by the rest of the code. This is known as scope.
There are two types of scope: local and global.
Global Scope
A global scope allows you to use the variable anywhere in your program.
If your variable is outside a function, it has global scope by default.
name = 'Bob' def print_name(): print('My name is ' + name) print_name()
My name is Bob
Notice that the function could use the variable name and print My name is Bob.
Local Scope
When you declare a variable inside a function, it only exists inside that function and can't be accessed from the outside.
def print_name(): name = "Bob" print('My name is ' + name) print_name()
My name is Bob
The variable name was declared inside the function, so the output is the same as before.
But this will throw an error:
def print_name(): name = 'Bob' print('My name is ' + name) print(name)
The output of the code above is:
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'name' is not defined
I tried to print the variable name from outside the function, but the scope of the variable was local and could not be found in a global scope.
Mixing Scopes
If you use the same name for variables inside and outside a function, the function will use the one inside its scope.
So when you call print_name(), the name='Bob' is used to print the phrase.
On the other hand, when calling print() outside the function scope, name="Sarah" is used because of its global scope.
name = "Sarah" def print_name(): name = 'Bob' print('My name is ' + name) print_name() print(name)
The output of the code above is:
My name is Bob Sarah
List Comprehensions
Sometimes we want to perform some very simple operations over the items of a list.
List comprehensions give us a succinct way to work on lists as an alternative to other methods of iteration, such as for loops.
Basic syntax
To use a list comprehension to replace a regular for loop, we can make:
[expression for item in list]
Which is the same as doing:
for item in list: expression
If we want some conditional to apply the expression, we have:
[expression for item in list if conditional ]
Which is the same as doing:
for item in list: if conditional: expression
Example 1: calculating the cube of a number
Regular way
numbers = [1, 2, 3, 4, 5] new_list = [] for n in numbers: new_list.append(n**3) print(new_list)
[1, 8, 27, 64, 125]
Using list comprehensions
numbers = [1, 2, 3, 4, 5] new_list = [] new_list = [n**3 for n in numbers] print(new_list)
[1, 8, 27, 64, 125]
Example 2: calculating the cube of a number only if it is greater than 3
Using the conditional, we can filter only the values we want the expression to be applied to.
Regular way
numbers = [1, 2, 3, 4, 5] new_list = [] for n in numbers: if(n > 3): new_list.append(n**3) print(new_list)
[64, 125]
Using list comprehensions
numbers = [1, 2, 3, 4, 5] new_list = [] new_list = [n**3 for n in numbers if n > 3] print(new_list)
[64, 125]
Example 3: calling functions with list comprehensions
We can also call functions using the list comprehension syntax:
numbers = [1, 2, 3, 4, 5] new_list = [] def cube(number): return number**3 new_list = [cube(n) for n in numbers if n > 3] print(new_list)
[64, 125]
Lambda Functions
A Python lambda function can only have one expression and can't have multiple lines.
It is supposed to make it easier to create some small logic in one line instead of a whole function as is usually done.
Lambda functions are also anonymous, which means there is no need to name them.
Basic Syntax
The basic syntax is very simple: just use the lambda keyword, define the parameters needed, and use ":" to separate the parameters from the expression.
The general forms is:
lambda arguments : expression
One parameter example
Look at this example using only one parameter
cubic = lambda number : number**3 print(cubic(2))
8
Multiple parameter example
If you want, you can also have multiple parameters.
exponential = lambda multiplier, number, exponent : multiplier * number**exponent print(exponential(2, 2, 3))
16
Calling the Lambda Function directly
You don't need to use a variable as we did before. Instead you can make use of parenthesis around the lambda function and another pair of parenthesis around the arguments.
The declaration of the function and the execution will happen in the same line.
(lambda multiplier, number, exponent : multiplier * number**exponent)(2, 2, 3)
16
Examples using lambda functions with other built-in functions
Map
The Map function applies the expression to each item in a list.
Let's calculate the cubic of each number in the list.
numbers = [2, 5, 10] cubics = list(map(lambda number : number**3, numbers)) print(cubics)
[8, 125, 1000]
Filter
The Filter function will filter the list based on the expression.
Let's filter to have only the numbers greater than 5.
numbers = [2, 5, 10] filtered_list = list(filter(lambda number : number > 5, numbers)) print(filtered_list)
[10]
Modules
After some time your code starts to get more complex with lots of functions and variables.
To make it easier to organize the code we use Modules.
A well-designed Module also has the advantage of being reusable, so you write code once and reuse it everywhere.
You can write a module with all the mathematical operations and other people can use it.
And, if you need, you can use someone else's modules to simplify your code, speeding up your project.
In other programming languages, these are also referred to as libraries.
Using a Module
To use a module we use the import keyword.
As the name implies we have to tell our program what module to import.
After that, we can use any function available in that module.
Let's see an example using the math module.
First, let's see how to have access to a constant, Euler's number.
import math math.e
2.718281828459045
In this second example, we are going to use a function that calculates the square root of a number.
It is also possible to use the as keyword to create an alias.
import math as m m.sqrt(121) m.sqrt(729)
11 27
Finally, using the from keyword, we can specify exactly what to import instead of the whole module and use the function directly without the module's name.
This example uses the floor() function that returns the largest integer less than or equal to a given number.
from math import floor floor(9.8923)
9
Creating a Module
Now that we know how to use modules, let's see how to create one.
It is going to be a module with the basic math operations add, subtract, multiply, divide and it is gonna be called basic_operations.
Create the basic_operations.py file with the four functions.
def add(first_num, second_num): return first_num + second_num def subtract(first_num, second_num): return first_num - second_num def multiply(first_num, second_num): return first_num * second_num def divide(first_num, second_num): return first_num / second_num
Then, just import the basic_operations module and use the functions.
import basic_operations basic_operations.add(10,2) basic_operations.subtract(10,2) basic_operations.multiply(10,2) basic_operations.divide(10,2)
12 8 20 5.0
if __name__ == '__main__'
You are in the process of building a module with the basic math operations add, subtract, multiply, and divide called basic_operations saved in the basic_operations.py file.
To guarantee everything is fine, you can run some tests.
def add(first_num, second_num): return first_num + second_num def subtract(first_num, second_num): return first_num - second_num def multiply(first_num, second_num): return first_num * second_num def divide(first_num, second_num): return first_num / second_num print(add(10, 2)) print(subtract(10,2)) print(multiply(10,2)) print(divide(10,2))
After running the code:
renan@pro-home:~$ python3 basic_operations.py
The output is:
12 8 20 5.0
The output for those tests are what we expected.
Our code is right and ready to share.
Let's import the new module run it in the Python console.
Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import basic_operations 12 8 20 5.0 >>>
When the module is imported our tests are displayed on the screen even though we didn't do anything besides importing basic_operations.
To fix that we use if __name__ == '__main__' in the basic_operations.py file like this:
def add(first_num, second_num): return first_num + second_num def subtract(first_num, second_num): return first_num - second_num def multiply(first_num, second_num): return first_num * second_num def divide(first_num, second_num): return first_num / second_num if __name__ == '__main__': print(add(10, 2)) print(subtract(10,2)) print(multiply(10,2)) print(divide(10,2))
Running the code directly on the terminal will continue to display the tests. But when you import it like a module, the tests won't show and you can use the functions the way you intended.
Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import basic_operations >>> basic_operations.multiply(10,2) 20 >>>
Now that you know how to use the if __name__ == '__main__', let's understand how it works.
The condition tells when the interpreter is treating the code as a module or as a program itself being executed directly.
Python has this native variable called __name__.
This variable represents the name of the module which is the name of the .py file.
Create a file my_program.py with the following and execute it.
print(__name__)
The output will be:
__main__
This tells us that when a program is executed directly, the variable __name__ is defined as __main__.
But when it is imported as a module, the value of __name__ is the name of the module.
Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import my_program my_program >>>
This is how the Python interpreter differentiates the behavior of an imported module and a program executed directly on the terminal.
Files
Creating, deleting, reading, and many other functions applied to files are an integral part of many programs.
As such, it is very important to know how to organize and deal with files directly from your code.
Let's see how to handle files in Python.
File create
First things first, create!
We are going to use the open() function.
This function opens a file and returns its corresponding object.
The first argument is the name of the file we are handling, the second refers to the operation we are using.
The code below creates the file "people.txt", the x argument is used when we just want to create the file. If a file with the same name already exists, it will throw an exception.
people_file = open("people.txt", "x")
You can also use the w mode to create a file. Unlike the x mode, it will not throw an exception since this mode indicates the writing mode. We are opening a file to write data into it and, if the file doesn't exist, it is created.
people_file = open("people.txt", "w")
The last one is the a mode which stands for append. As the name implies, you can append more data to the file, while the w mode simply overwrites any existing data.
When appending, if the file doesn't exist, it also creates it.
people_file = open("people.txt", "a")
File write
To write data into a file, you simply open a file with the w mode.
Then, to add data, you use the object return by the open() function. In this case, the object is called people_file. Then you call the write() function passing the data as argument.
people_file = open("people.txt", "w") people_file.write("Bob\n") people_file.write("Mary\n") people_file.write("Sarah\n") people_file.close()
We use \n at the end to break the line, otherwise the content in the file will stay in the same line as "BobMarySarah".
One more detail is to close() the file. This is not only a good practice, but also ensures that your changes were applied to the file.
Remember that when using w mode, the data that already existed in the file will be overwritten by the new data. To add new data without losing what was already there, we have to use the append mode.
File append
The a mode appends new data to the file, keeping the existing one.
In this example, after the first writing with w mode, we are using the a mode to append. The result is that each name will appear twice in the file "people.txt".
#first write people_file = open("people.txt", "w") people_file.write("Bob\n") people_file.write("Mary\n") people_file.write("Sarah\n") people_file.close() #appending more data #keeping the existing data people_file = open("people.txt", "a") people_file.write("Bob\n") people_file.write("Mary\n") people_file.write("Sarah\n") people_file.close()
File read
Reading the file is also very straightforward: just use the r mode like so.
If you read the "people.txt" file created in the last example, you should see 6 names in your output.
people_file = open("people.txt", "r") print(people_file.read())
Bob Mary Sarah Bob Mary Sarah
The read() function reads the whole file at once. If you use the readline() function, you can read the file line by line.
people_file = open("people.txt", "r") print(people_file.readline()) print(people_file.readline()) print(people_file.readline())
Bob Mary Sarah
You can also loop to read the lines like the example below.
people_file = open("people.txt", "r") for person in people_file: print(person)
Bob Mary Sarah Bob Mary Sarah
Delete a File
To delete a file, you also need the os module.
Use the remove() method.
import os os.remove('my_file.txt')
Check if a File Exists
Use the os.path.exists() method to check the existence of a file.
import os if os.path.exists('my_file.txt'): os.remove('my_file.txt') else: print('There is no such file!')
Copy a File
For this one, I like to use the copyfile() method from the shutil module.
from shutil import copyfile copyfile('my_file.txt','another_file.txt')
There are a few options to copy a file, but copyfile() is the fastest one.
Rename and Move a File
If you need to move or rename a file you can use the move() method from the shutil module.
from shutil import move move('my_file.txt','another_file.txt')
Classes and Objects
Classes and Objects are the fundamental concepts of Object-Oriented Programming.
In Python, everything is an object!
A variable (object) is just an instance of its type (class).
That's why when you check the type of a variable you can see the class keyword right next to its type (class).
This code snippet shows that my_city is an object and it is an instance of the class str.
my_city = "New York" print(type(my_city))
<class 'str'>
Differentiate Class x Object
The class gives you a standard way to create objects. A class is like a base project.
Say you are an engineer working for Boeing.
Your new mission is to build the new product for the company, a new model called 747-Space. This aircraft flies higher altitudes than other commercial models.
Boeing needs to build dozens of those to sell to airlines all over the world, and the aircrafts have to be all the same.
To guarantee that the aircrafts (objects) follow the same standards, you need to have a project (class) that can be replicable.
The class is a project, a blueprint for an object.
This way you make the project once, and reuse it many times.
In our code example before, consider that every string has the same behavior and the same attributes. So it only makes sense for strings to have a class str to define them.
Attributes and Methods
Objects have some behavior which is is given by attributes and methods.
In simple terms, in the context of an object, attributes are variables and methods are functions attached to an object.
For example, a string has many built-in methods that we can use.
They work like functions, you just need to separate them from the objects using a ..
In this code snippet, I'm calling the replace() method from the string variable my_city which is an object, and an instance of the class str.
The replace() method replaces a part of the string for another and returns a new string with the change. The original string remains the same.
Let's replace 'New' for 'Old' in 'New York'.
my_city = 'New York' print(my_city.replace('New', 'Old')) print(my_city)
Old York New York
Creating a Class
We have used many objects (instances of classes) like strings, integers, lists, and dictionaries. All of them are instances of predefined classes in Python.
To create our own classes we use the class keyword.
By convention, the name of the class matches the name of the .py file and the module by consequence. It is also a good practice to organize the code.
Create a file vehicle.py with the following class Vehicle.
class Vehicle: def __init__(self, year, model, plate_number, current_speed = 0): self.year = year self.model = model self.plate_number = plate_number self.current_speed = current_speed def move(self): self.current_speed += 1 def accelerate(self, value): self.current_speed += value def stop(self): self.current_speed = 0 def vehicle_details(self): return self.model + ', ' + str(self.year) + ', ' + self.plate_number
Let's break down the class to explain it in parts.
The class keyword is used to specify the name of the class Vehicle.
The __init__ function is a built-in function that all classes have. It is called when an object is created and is often used to initialize the attributes, assigning values to them, similar to what is done to variables.
The first parameter self in the __init__ function is a reference to the object (instance) itself. We call it self by convention and it has to be the first parameter in every instance method, as you can see in the other method definitions def move(self), def accelerate(self, value), def stop(self), and def vehicle_details(self).
Vehicle has 5 attributes (including self): year, model, plate_number, and current_speed.
Inside the __init__, each one of them is initialized with the parameters given when the object is instantiated.
Notice that current_speed is initialized with 0 by default, meaning that if no value is given, current_speed will be equal to 0 when the object is first instantiated.
Finally, we have three methods to manipulate our vehicle regarding its speed: def move(self), def accelerate(self, value), and def stop(self).
And one method to give back information about the vehicle: def vehicle_details(self).
The implementation inside the methods work the same way as in functions. You can also have a return to give you back some value at the end of the method as demonstrated by def vehicle_details(self).
Using the Class
To use the class in your terminal, import the Vehicle class from the vehicle module.
Create an instance called my_car, initializing year with 2009, model with 'F8', plate_number with 'ABC1234', and current_speed with 100.
The self parameter is not taken into consideration when calling methods. The Python interpreter infers its value as being the current object/instance automatically, so we just have to pass the other arguments when instantiating and calling methods.
Now use the methods to move() the car which increases its current_speed by 1, accelerate(10) which increases its current_speed by the value given in the argument, and stop() which sets the current_speed to 0.
Remember to print the value of current_speed at every command to see the changes.
To finish the test, call vehicle_details() to print the information about our vehicle.
>>> from vehicle import Vehicle >>> >>> my_car = Vehicle(2009, 'F8', 'ABC1234', 100) >>> print(my_car.current_speed) 100 >>> my_car.move() >>> print(my_car.current_speed) 101 >>> my_car.accelerate(10) >>> print(my_car.current_speed) 111 >>> my_car.stop() >>> print(my_car.current_speed) 0 >>> print(my_car.vehicle_details()) F8, 2009, ABC1234
If we don't set the initial value for current_speed, it will be zero by default as stated before and demonstrated in the next example.
>>> from vehicle import Vehicle >>> >>> my_car = Vehicle(2009, 'F8', 'ABC1234') >>> print(my_car.current_speed) 0 >>> my_car.move() >>> print(my_car.current_speed) 1 >>> my_car.accelerate(10) >>> print(my_car.current_speed) 11 >>> my_car.stop() >>> print(my_car.current_speed) 0 >>> print(my_car.vehicle_details()) F8, 2009, ABC1234
Inheritance
Let's define a generic Vehicle class and save it inside the vehicle.py file.
class Vehicle: def __init__(self, year, model, plate_number, current_speed): self.year = year self.model = model self.plate_number = plate_number self.current_speed = current_speed def move(self): self.current_speed += 1 def accelerate(self, value): self.current_speed += value def stop(self): self.current_speed = 0 def vehicle_details(self): return self.model + ', ' + str(self.year) + ', ' + self.plate_number
A vehicle has attributes year, model, plate_number, and current_speed.
The definition of vehicle in the Vehicle is very generic and might not be suitable for trucks, for instance, because it should include a cargo attribute.
On the other hand, a cargo attribute does not make much sense for small vehicles like motorcycles.
To solve this we can use inheritance.
When a class (child) inherits another class (parent), all the attributes and methods from the parent class are inherited by the child class.
Parent and Child
In our case, we want a new Truck class to inherit everything from the Vehicle class. Then we want it to add its own specific attribute current_cargo to control the addition and removal of cargo from the truck.
The Truck class is called a child class that inherits from its parent class Vehicle.
A parent class is also called a superclass while a child class is also known as a subclass.
Create the class Truck and save it inside the truck.py file.
from vehicle import Vehicle class Truck(Vehicle): def __init__(self, year, model, plate_number, current_speed, current_cargo): super().__init__(year, model, plate_number, current_speed) self.current_cargo = current_cargo def add_cargo(self, cargo): self.current_cargo += cargo def remove_cargo(self, cargo): self.current_cargo -= cargo
Let's break down the class to explain it in parts.
The class Vehicle inside the parentheses when defining the class Truck indicates that the parent Vehicle is being inherited by its child Truck.
The __init__ method has self as its first parameter, as usual.
The parameters year, model, plate_number, and current_speed are there to match the ones in the Vehicle class.
We added a new parameter current_cargo suited for the Truck class.
In the first line of the __init__ method of the Truck class we have to call the __init__ method of the Vehicle class.
To do that we use super() to make a reference to the supperclass Vehicle, so when super().__init__(year, model, plate_number, current_speed) is called we avoid repetition of our code.
After that, we can assign the value of current_cargo normally.
Finally, we have two methods to deal with the current_cargo: def add_cargo(self, cargo):, and def remove_cargo(self, cargo):.
Remember that Truck inherits attributes and methods from Vehicle, so we also have an implicit access to the methods that manipulate the speed: def move(self), def accelerate(self, value), and def stop(self).
Using the Truck class
To use the class in your terminal, import the Truck class from the truck module.
Create an instance called my_truck, initializing year with 2015, model with 'V8', plate_number with 'XYZ1234', current_speed with 0, and current_cargo with 0.
Use add_cargo(10) to increase current_cargo by 10, remove_cargo(4), to decrease current_cargo by 4.
Remember to print the value of current_cargo at every command to see the changes.
By inheritance, we can use the methods from the Vehicle class to move() the truck which increases its current_speed by 1, accelerate(10) which increases its current_speed by the value given in the argument, and stop() which sets the current_speed to 0.
Remember to print the value of current_speed at every interaction to see the changes.
To finish the test, call vehicle_details() inherited from the Vehicle class to print the information about our truck.
>>> from truck import Truck >>> >>> my_truck = Truck(2015, 'V8', 'XYZ1234', 0, 0) >>> print(my_truck.current_cargo) 0 >>> my_truck.add_cargo(10) >>> print(my_truck.current_cargo) 10 >>> my_truck.remove_cargo(4) >>> print(my_truck.current_cargo) 6 >>> print(my_truck.current_speed) 0 >>> my_truck.accelerate(10) >>> print(my_truck.current_speed) 10 >>> my_truck.stop() >>> print(my_truck.current_speed) 0 >>> print(my_truck.vehicle_details()) V8, 2015, XYZ1234
Exceptions
Errors are a part of every programmer's life, and knowing how to deal with them is a skill on its own.
The way Python deals with errors is called 'Exception Handling'.
If some piece of code runs into an error, the Python interpreter will raise an exception.
Types of Exceptions
Let's try to raise some exceptions on purpose and see the errors they produce.
First, try to add a string and an integer
'I am a string' + 32
Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: must be str, not int
Now, try to access an index that doesn't exist in a list.
A common mistake is to forget that sequences are 0-indexed, meaning the first item has index 0, not 1.
In this example, the list car_brands ends at index 2.
car_brands = ['ford', 'ferrari', 'bmw'] print(car_brands[3])
Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: list index out of range
If we try to print a variable that doesn't exist:
print(my_variable)
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'my_variable' is not defined
Math doesn't allow division by zero, so trying to do so will raise an error, as expected.
32/0
Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: division by zero
This was just a sample of the kinds of exceptions you might see during your daily routine and what can cause each of them.
Exception Handling
Now we know how to cause errors that will crash our code and show us some message saying something is wrong.
To handle these exceptions just make use of the try/except statement.
try: 32/0 except: print('Dividing by zero!')
Dividing by zero!
The example above shows the use of the try statement.
Put the block of code that may cause an exception inside the try scope. If everything runs alright, the except block is not invoked. But if an exception is raised, the block of code inside the except is executed.
This way the program doesn't crash and if you have some code after the exception, it will keep running if you want it to.
Specific Exception Handling
In the last example the except block was generic, meaning it was catching anything.
Good practice it to specify the type of exception we are trying to catch, which helps a lot when debugging the code later.
If you know a block of code can throw an IndexError, specify it in the except:
try: car_brands = ['ford', 'ferrari', 'bmw'] print(car_brands[3]) except IndexError: print('There is no such index!')
There is no such index!
You can use a tuple to specify as many exception types as you want in a single except:
try: print('My code!') except(IndexError, ZeroDivisionError, TypeError): print('My Excepetion!')
else
It is possible to add an else command at the end of the try/except. It runs only if there are no exceptions.
my_variable = 'My variable' try: print(my_variable) except NameError: print('NameError caught!') else: print('No NameError')
My variable No NameError
Raising Exceptions
The raise command allows you to manually raise an exception.
This is particularly useful if you want to catch an exception and do something with it -- like logging the error in some personalized way like redirecting it to a log aggregator, or ending the execution of the code since the error should not allow the progress of the program.
try: raise IndexError('This index is not allowed') except: print('Doing something with the exception!') raise
Doing something with the exception! Traceback (most recent call last): File "<stdin>", line 2, in <module> IndexError: This index is not allowed
finally
The finally block is executed independently of exceptions being raised or not.
They are usually there to allow the program to clean up resources like files, memory, network connections, etc.
try: print(my_variable) except NameError: print('Except block') finally: print('Finally block')
Except block Finally block
Conclusion
That's it!
Congratulations on reaching the end.
I want to thank you for reading this article.
If you want to learn more, checkout my blog renanmf.com.
Remember to download a PDF version of this Python Guide for Beginners.
You can also find me on Twitter: @renanmouraf.
via freeCodeCamp.org https://ift.tt/2wM85mu
0 notes
Text
300+ TOP Sencha Touch Interview Questions and Answers
Sencha Touch Interview Questions for freshers experienced :-
1. What is Sencha Touch? Sencha Touch is an UI (User Interface) JavaScript library. It is written in JavaScript. It is used to build mobile interface quickly and easily. It works on many devices. 2. What are the types of data integrations? The types of data Integrations: AJAX JSONP YQL 3. What is the latest version of Sencha Touch? The latest version of Sencha Touch is 2.4. 4. What are the networks supported by Sencha Touch? Sencha Touch supports following network: HTTP GPS (location-based web services and accelerometer input). 5. What are the languages supported by Sencha Touch? Sencha Touch supports different languages: HTML5 CSS3 Java Script 6. How can we write a hello world program in Sencha Touch? We can write a hello world program by using following codes: Ext.Viewport.add({ xtype: 'panel', html: 'Hello World!' }); 7. What is the stable release version of Sencha Touch? Stable version of Sencha Touch is 2.4.2 and released on June 15, 2015. 8. What are the features of Sencha Touch? The following features of Sencha Touch are: It is easy to setup. It provides adaptive layouts, animations. It provides a set of graphical user interface controls or components. It helps to built-in transitions effects It provides code compatibility of new version with older one. It supports touch event management like: Tap, Double Tap, pinch, Swip and Scrole etc. 9. What are the services of Sencha Touch? Sencha Touch provides various services that are: Comprehensive Services. User Interface (UI) design and development. System architecture specification and review Development Team Mentoring Custom component development etc. 10. What is the difference between jQuery Mobile and Sencha Touch? There are following difference between jQuery and Sencha Touch that are listed table. jQuery Mobile Sencha Touch It supports more than one mobile platform. It supports iOS, Android and Blackberry. It provides UI features with lots of control. It also provides UI features but it is best. It is easy to use. But it is not. It supports only markup and jquery script. But it supports more MVC style application.
Sencha Touch Interview Questions 11. What are the limitations of Sencha Touch? There are following limitations of Sencha Touch that are: It does not have access to the contacts. It does not provide the push notification facility, It is paid for commercial applications. It is not good for hardcore graphics and animations apps such as for gaming apps. 12. What are naming convention in Sencha Touch? In Sencha Touch, naming convention is used to make code more readable and understandable to the other programmers. Following are some naming convention: Name Convention Description Class Name It should start with uppercase letter and followed by camel case E.g. StudentClass. Method Name It should start with lowercase letter and followed by camel case E.g. studentMethod (). Variable Name It should start with lowercase letter and followed by camel case E.g. studentName. Constant Name It should be in uppercase only E.g. COUNT, MAX_VALUE. Property Name It should start with lowercase letter and followed by camel case E.g.enableColumnResize = true. 13. What are events and how to write method in Sencha Touch? In Sencha Touch, Events are something which gets fired when something happens to the class. The following methods of writing events: Built in events using listeners Attaching events later Custom events 14. What are Sencha Touch Layouts and its library? Sencha Touch layouts are a way to arrange an element in to container. It could be horizontal and vertical. The following libraries are: hBox: It allows the element to categories in the horizontal manner. vBox: It allows the element to categories in the vertical manner. Fit : It allows the container to filled with a single panel. Card(TabPanel): It helps to arrange different components in tab fashion. 15. What are the devices supported by Sencha Touch? Android, iOS, Windows, Tizen, Microsoft Surface Pro, RT and BlackBerry devices are supported by Sencha Touch. 16. What are the project structures of Sencha Touch? The project structures of Sencha Touch are given below: src resources CSS files Images JavaScript App Folder Controller Contoller.js Model Model.js Store Store.js View View.js Utils Utils.js app.js HTML files 17. What is data package in Sencha Touch? In Sencha Touch, data package is responsive for carrying of data manipulation either storing or loading the data. It is related to model, store and proxies. 18. How can we write a simple phone profile? We can write a simple phone profile by using following code: Ext.define('Mail.profile.Phone', { extend: 'Ext.app.Profile', config: { name: 'Phone', views: }, isActive: function() { return Ext.os.is('Phone'); } }); 19. What are the devices detection methods in Sencha Touch? In Sencha Touch, device detection methods are given in below table Device Detection method Description Ext.os.is.iPad It will return true if we are using IPad. Ext.os.is.iPhone It will return true if we are using iPhone else it returns false. Ext.os.is.iPod It will return true if we are using iPod. 20. In which language Sencha Touch was written? Sencha Touch was written in Java Script language. 21. What is the difference between Native Apps and Web Apps? There are following difference between Native Apps and Web Apps. Native Apps Web Apps It is easy to access to device features. Any device can access app. Direct access to users through marketplace. Do not need to go through marketplaces. It is high level function capabilities. Do not need to participate in Apple Developer program. It is easier to make available offline. Cannot easily access device features like Motion. 22. Which command is used to create an app in Sencha Touch? In Sencha Touch, “sencha -sdk path/to/touch generate app appName” command is used to create an app. 23. What is Sencha Inspector? Sencha Inspector is a debugging tool that is used to debug any issue in Sencha Code during development. 24. What are the limitations of Sencha Touch? There are following limitation of Sencha Touch: The app does not access device’s camera, contacts and accelerometer. It does not provide the push notifications. Commercial applications are not free. It is not good for hardcore graphics and animations. 25. How can we add CDN link in Sencha Touch? We can add CDN link in Sencha Touch by using following given code: 26. What are the files while installing the project? There are various files while installing the projects: App app.js app.json index.html package.json resources 27. Is Sencha Touch a W3c Standard? Yes, Sencha Touch a W3c Standard. 28. What are the types of layouts in Sencha Touch? There are following types of layouts in Sencha Touch. hBox Vbox Fit Card 29. What is XHR2 in Sencha Touch? In Sencha Touch, XHR2 stands for xmlHttpRequest level 2. It is used to request data from the server. It is also used to configure with Ajax. 30. Who is the developer of Sencha Touch? Sencha is the developer of Sencha Touch. Sencha Touch Questions and Answers Pdf Download Read the full article
0 notes
Text
Aspose.Newsletter February 2019: Enhance Productivity using JDK 11 Compatible PDF API & More
Aspose Newsletter for February 2019 has now been published that highlights all the newly supported features offered in the recent releases. It includes information about Enhancing productivity & performance using JDK 11 compatible PDF API, Loading Excel workbook efficiently without loading VBA project, Use latest version of Aspose.PDF for C++ with new codebase changes, Create PST folder hierarchy with string notation, Detect archive-based file format and work with AMF files in .NET and Java 3D applications and more.
Planning to move PDF applications to Java 11 or 10?
Enhance productivity & performance using JDK 11 compatible PDF API. Aspose.PDF for Java offers native API to generate, manipulate, convert, compress, render, secure and print PDF documents without needing Adobe Acrobat. Developers can also create new PDF documents directly through the API or via XML templates. With just a few lines of code – Convert PDF to Word, Excel, PowerPoint, HTML, images and many other file formats. Download Trial
Loading Excel workbook efficiently without loading VBA project
Aspose.Cells APIs provide the ability to create, manipulate, convert or render Microsoft Excel spreadsheets. Excel files might have large number of macros but sometimes, it is needed to load worksheets only without loading these VBA projects just like extracting the sheet names from loaded workbook. Aspose.Cells has introduced a filter option LoadDataFilterOptions.VBA within Aspose.Cells for .NET, Java and Android via Java APIs that can load/skip VBA projects.
Use latest version of Aspose.PDF for C++ with new codebase changes
Aspose.PDF for C++ is a native C++ API to create, read, edit or render PDF documents from within C++ applications. The latest version announces entire codebase change, ported from Aspose.PDF for .NET to C++ API this making it more exciting and appealing for developers along with improved performance and stability. Read more details
Email API for .NET & Java – Create PST folder hierarchy with string notation
Aspose.Email offers native email formats processing APIs to create, edit, convert and transmit emails without using Microsoft Outlook. This release adds an overload to AddSubFolder(string name, bool createHierarchy) and CreatePredefinedFolder(string name, StandardIpmFolder defaultFolder, bool createHierarchy) functions that enable you to create folder hierarchy using string notation within any type of .NET and Java applications.
Detect archive-based file format and work with AMF files in .NET and Java 3D applications
Aspose.3D API seamlessly supports manipulating 3D documents without using any 3D modeling and rendering software. The latest version now announces support of standard 3D printing format i.e. AMF along with a new feature to detect archive-based file format within .NET and Java applications. Read more details
Code Example: Applying custom formatting for Time field and control threshold for TIFF binarization in .NET and Java
Aspose.Words offers market-leading APIs for word documents processing on any platform. Aspose.Words for .NET now supports a new feature to apply custom formatting to Time field as per customer requirements. A new property ThresholdForFloydSteinbergDithering in ImageSaveOptions class is also introduced to control threshold for TIFF binarization within .NET and Java applications.
Code Example: Printing PDF documents using PrintController of Aspose.PDF for .NET
Aspose.PDF for .NET is an advance PDF files processing and parsing API to create, edit, protect and convert PDF documents. The latest release of PDF API offers PrintController class that helps saving a System.Drawing.Printing.PrintDocument as PDF format. Read more
Code Example: Convert Word document to HTML format in SharePoint Apps
Aspose.Words for SharePoint supports converting and combining word documents within Microsoft SharePoint applications. The entire codebase is optimized to improve the overall functionality. Using the latest version – users can convert Word document to HTML format now. Read more
Read dotted barcodes from TIFF images in JasperReports
Aspose.BarCode for JasperReports is a flexible JasperReports and JasperServer extension to generate and display high quality barcode labels in your applications. The latest version adds the ability to read dotted barcodes from Tiff images within JasperReports. Read more
Code Example: Rendering IGES and PLT drawings to PDF in .NET and Java applications
Aspose.CAD APIs allow developers to convert CAD files to PDF, XPS and raster images in .NET and Java applications. The latest version now supports exporting IGES and PLT files to PDF using CadRasterizationOption and PdfOptions
Updates about new Product Releases
Aspose.Total for Cloud – RTF compression implemented, and other enhancements.
Aspose.Total for Android – all the latest versions of Aspose Android APIs.
Aspose.Total for SharePoint – a compilation of Aspose latest SharePoint products.
Aspose.Total for Reporting Services– a compilation of Aspose latest Reporting Services products
Aspose.Total for JasperReports – The latest versions of Aspose JasperReports products.
Aspose.Total for C++ – The latest versions of our C++ products packaged into one product suite.
Aspose.Words for Reporting Services 18.12 – Upgraded Aspose.Words for Reporting Services to Aspose.Words for .NET 18.12.
Aspose.Slides for .NET 18.12 – Improved fonts and EMF images rendering.
Aspose.Diagram for .NET and Java 18.12 – Improved conversion of VISIO diagrams to PDF, PNG and GIF file formats.
Aspose.Words for JasperReports 18.12 – Upgraded Aspose.Words for JasperReports to Aspose.Words for Java 18.12 and fixed issue related to table cell height.
Aspose.Tasks for .NET 19.1 – Fixed reported issues and improved reading MS Project files.
Aspose.Slides for Java 18.12 – Improved PowerPoint file formats rendering issues.
Aspose.Note for .NET 19.1 – Improved refactor rendering for underline text and rich text while saving .ONE documents to PDF.
Aspose.Slides for C++ 18.12 – Improve EMF/WMF format processing.
Aspose.HTML for .NET 19.1 – Improved cascading style sheets (CSS) processing for high fidelity rendering.
Collect a copy of Aspose Newsletter, February 2018 edition
Collect the English version of this newsletter
#File Formats Management APIs#move PDF apps to Java11#Load Excel workbook efficiently#Create PST folder hierarchy#Detect archive-based file format#Read dotted barcodes from TIFF
0 notes
Text
Load any HTML with Self-Closing Tags & Convert It to Excel File inside Android Apps
What’s new in this release?
Aspose development team is pleased to announce the new release of Aspose.Cells for Android via Java 18.12. Depiction of data through HTML page is very common, however this page can be opened in variety of devices including mobiles, tabs and other hand held devices which contain small screens. The size of the columns is defined in “pt” which works in many cases. However there can be case where this fixed size may not be required. For example if container panel width is 600px where this HTML page is being displayed. In this case users may get horizontal scrollbar if the generated table width is bigger. This requirement is addressed by providing scalable units like em or percent for a better presentation. Empty tags are very common while working with HTML like we can face <td></td> or simply <td/>. Earlier self-closing tags were not supported however now this support is provided. Now users can load any HTML with self-closing tags and convert it to Excel file. Named regions can have English formulae and this file can be used in environments where systems are configured to German Locale. There is need to translate these English formulae completely to German language for correct usage in Excel configured for German language. This feature is fully functional and can be used without any extra coding. Excel provides custom filters like filter rows which begins with and ends with some specific string. Aspose.Cells provides rich features to manage shapes in the spreadsheet. Sometimes there is needed to get the connection points of a shape for aligning or placing the shapes at appropriate place. For this purpose all the connection points are required. Pivot tables are very common reports which are present in the workbooks. These reports are updated time by time and it is important to know the last time when report was updated for better decision making. Aspose.Cells has provided this feature by introducing property RefreshDate. Similarly name of the person who updated the pivot table is also provided as property RefreshedByWho. Smart art is used for better representation of information however earlier the text in the smart art shapes was fixed. This limitation is gone now as now smart art text can be updated. For this purpose shape.setText() function is introduced which sets new text in the smart art shape. Data validation is done in variety of ways to control the input in the Excel file. Like limit can be defined for a cell within which some number can be entered, otherwise error message is raised. Issues were faced for validation of large numbers like 12345678901 etc. in the past but now this much large numbers are supported by Aspose.Cells. Aspose.Cells has introduced rendering active worksheet in a workbook to SVG. For this purpose load an Excel file into workbook object and set the active sheet index like for Sheet2, set index to 1. Then save the Workbook as SVG which will render active worksheet to SVG. Workbook can have multiple sheets which are rendered as multiple tab pages when converted to HTML using Excel. Similarly if a workbook contains single sheet, it shows one tab page when converted to HTML using Excel. This conversion was working fine for multiple sheets while using Aspose.Cells. However for single sheet workbook, there was no tab page and only HTML file was created without creating the separate folder containing CSS. Now Aspose.Cells has enhanced its library to create similar output for single sheet workbooks as compared to output created by Excel. In complex Excel files (XLSM/XSLB) there can be large amount of macros which can be very very long. Many times there is a need to load the workbooks without loading these VBA projects like just extracting the sheet names from loaded workbook. In this case we need a filter which can load VBA projects in when they are actually required. This time Aspose.Cells has introduced a filter option LoadDataFilterOptions.VBA which can be used for this purpose. Textbox is very common control which can be used in a worksheet. This is not necessary that text in the textbox is fixed. It may have tags which can be replaced with some text at runtime. It helps users to configure the controls as per the data on the sheet or from some other source. Worksheet.replace can be used for this purpose and textbox can be set with the desired text. It can convert worksheet to HTML but rendering entire sheet at once may not be required always. Users may require just a selected area of the sheet to be rendered to HTML. Worksheets contain page setup where print area can be set. A worksheet can have different types of validations including dropdown. There can be a need where user may want to detect the type of validation and take some decision based on this information. This release includes plenty of improved features and bug fixes as listed below
Change returned value for getting Connection points
Provide ability to export range as HTML
Data bars are missing when XLSX is converted to HTML
Value still exists when XLSX is converted to HTML
Convert left right ribbon shape to image
Aspose.Cells for Java JavaDocs - missing package-list file
Font is not a valid HTML5 and self-closing tag and web browsers misrepresent its contents
Wrong count of validation values is read from XLSX
Issue while treating consecutive delimiters as distinct
Date format is incorrect for Japanese locale
LightCells API fails to load huge file
An exception(StackOverFlow) raises when saving to PDF output
Wrong value calculated by ROUNDUP()
Copy a range with PasteType.ALL (Paste options) not copying row heights properly
Hyperlink text formatting lost when new text is set
Invalid Russian date format output
Issue with SheetRender fonts
Exception "java.lang.OutOfMemoryError: Java heap space" when rendering MS Excel file to PDF
Quotes appear in formula when retrieving the cell formula via Aspose.Cells
Performance degradation when using conditional formatting
Chart line is missing in XLSX->PNG conversion
Problem with getActualChartSize method
SmartArt doesn't copy when workbook is copied
Text formatting is missing in HTML output of excel range
Icon Sets become misaligned when XLSX is converted to HTML
Exporting named range data is not correctly rendered to HTML (Java)
Named Range Issue
Validation always returns true for 'getInCellDropDown()' method
Wrong culture custom format gets returned for different locales (Germany, French, Italy and Spain)
Excel To PDF conversion - Gauge chart rendering issue
PDF rendition throws OutOfMemoryError exception
Other most recent bug fixes are also included in this release.
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Cells for Android documentation that may guide users briefly how to use Aspose.Cells for performing different tasks like the followings.
Recognise self-closing tags
Get Connection points from shape
Overview: Aspose.Cells for Android
Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.
More about Aspose.Cells for .NET
Homepage of Aspose.Cells for Android
Download Aspose.Cells for Android
Online documentation of Aspose.Cells for Android
#self-closing tags in HTML#update smart art text#Export print area range to HTML#Scalable column width#Custom filter with BeginsWith#Java Android Excel API#Data validation for huge numbers
0 notes
Text
Java 11 Support & Export Word Files Headers Footers to Plain Text TXT File in Java Apps
What's New in this Release?
Aspose development team is happy to announce the monthly release of Aspose.Words for Java 18.11. The release of this month contains number of new features, enhancements and bug fixes of the issues reported by our users in previous versions. A new feature has been added in Aspose.Words 18.11 to export all headers and footers at the end of document. We have added new property TxtSaveOptions.ExportHeadersFootersMode in this version of Aspose.Words. The main advantage of new property over the old TxtSaveOptions.ExportHeadersFooters property is that it has new headers and footers export mode: ‘AllAtEnd’. In this mode Aspose.Words acts the way similar to MS Word; all headers and footers are placed after all section bodies at the very end of a document. There are 81 improvements and bug fixes part of this regular monthly release, such as Aspose.Words for Java release jar is tested on Java 11, Compatibility with GroupDocs Total License is improved, GraphicsQualityOptions is better mapped to Java, yet another step to shrink (already small) pixel difference between .Net and Java generated images, borders, etc, JavaDoc for obsolete members become more clear, Fixed hang with autosized tables when cell has right aligned floaters, Fixed wrong visual order of text in specific cases, Fixed non-breaking space widths calculation, Implemented support for floating table metrics when calculating grid, ROP (raster operations) emulation code was improved, resulting in a significant performance boost (up to 5 times) when rendering the corresponding metafiles, Improved legacy vertical writing support in EMF rendering. Fonts with the ‘@’ prefix additionally rotate the Japanese glyphs, Improved calculation of the shape boundaries, more accurately mimicking the MS Word output, Improved the rendering of DrawingML charts canvases overlay. Markers of the “nofill” series are rendered on the foreground, Improved rendering of DrawingML chart axes for documents created using MS Word 2007, Fixed incorrect resolution of the system “window” color when rendering of VML shapes, fixed issue with underline/strikeout text effects in EMF/WMF rendering, Fixed a document rendering issue when font with English name could not be found in the system with a different locale, Fixed bug with rendering of DrawingML chart markers, if series data are not sorted in ascending order, Fixed a bug causing shifts of rotated shapes in DrawingML chart while rendering, provided TxtSaveOptions.ExportHeadersFootersMode property and many more. The list of most notable new and improved features added in this release are given below
Provide TxtSaveOptions.ExportHeadersFootersMode Property
Removing colon between empty MERGEFIELDs
Add Table property for 'Allow spacing between cells' option
Implement mass copy of styles
DOCX to HTML conversion issue with alignment of math images
CustomBarcodeGenerator is not available for netstandard.
Customer wants to get extensions of embedded files
Update to SkiaSharp 1.60.3
TestDefect3613 Gradient fill has artifact line.
TestJira13671 metafile is rendered improperly
/table grid/ Docx to Pdf conversion issue with table position
Document.Protect does not work with AllowOnlyFormFields protection type
Rework performance tests to use the new engine
Aspose.Words for Java - API reference doesn't contain information about obsolete properties and methods
Unsupported PNG image subformat while converting to PDF.
Run Aspose.Words jdk16 jar under JDK 11
SVG round and square
Encrypted ODT file cannot be opened with OOo
Non-breakable space vanishes in Online API JavaDoc.
Absent crop on Svg Simple Stroke Line Cap.
When DOCX is saved as PDF, images are shown as red X
Canvas with half-tone meshing rendered unreadable
Images are distorted in generated PDF
Dashes in bullets list disappear in rendered PDF
Incorrect color of the axis if WordStyle2010 is false after converting to PDF
Empty pages are created after conversion from Docx to Doc
Color Shading issues of Drawings in generated PDF
Font Changed after a load/save Cycle of an RTF File
DOCX to PDF conversion issue with SAVEDATE rendering
Combo charts with custom combination renders incorrectly
Incorrect position of Picture in PDF
Problem with ListNum Cross References when converting to PDF
Image misplaced in rendered PDF
The user shape in the chart is shifted after converting to PDF
Aspose.Words considers TextBox shapes as Rectangles
An evaluation mark is added to a nested document being inserted dynamically while building a report in a venture licensed mode
FindReplaceOptions.FindWholeWordsOnly does not replace standalone word
Some PostScript tests fail with GoldDifferenceException by circle
Chart color is changed after using Document.AppendDocument
A Shape in Table gets cropped when rendered to fixed page formats
Layout looks broken when rendering barcode
Paragraph border is lost in output ODT
Styles.AddCopy does not copy list number style
Shape is rendered improperly
Some elements in charts missing when converting DOCX to PDF
RTL text has wrong order
The output PDF document words are getting mixed up
Font of tab is changed after DOCX-HTML-DOCX round-trip
Foreign language text inside WordArt rendered incorrectly in PDF
Other most recent bug fixes are also included in this release
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Words for .NET documentation that may guide users briefly how to use Aspose.Words for performing different tasks like the followings.
Export Headers Footers to Plain Text TXT File & Java 11 Support
Copy All Styles from Template
Overview: Aspose.Words
Aspose.Words is a word processing component that enables .NET, Java & Android applications to read, write and modify Word documents without using Microsoft Word. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, TOC updated/rebuilt, Embedded OOXML, Footnotes rendering and support of DOCX, DOC, WordprocessingML, HTML, XHTML, TXT and PDF formats (requires Aspose.Pdf). It supports both 32-bit and 64-bit operating systems. You can even use Aspose.Words for .NET to build applications with Mono.
More about Aspose.Words
Homepage Java Word Library
Download Aspose.Words for Java
Online documentation of Aspose.Words
#Export Headers Footers to Plain Text#Java 11 Support#floating table metrics support#vertical writing support#support for EMF rendering#Java Word Processing APIs#rendering of DrawingML chart markers
0 notes
Text
Convert Equation XML to Office Math & Animated GIF Bookmarks inside Java Apps
What's New in this Release?
Aspose development team is happy to announce the monthly release of Aspose.Words for Java 18.9. Starting from Aspose.Words 18.9, the bookmarks are allowed on block, cell and row levels. It has added AnnotationsAtBlockLevel and AnnotationsAtBlockLevelAsDefault properties in LoadOptions class to work with block level bookmarks. A new proeprty LoadOptions.ConvertShapeToOfficeMath has been added in this version of Aspose.Words to convert shapes with EquationXML to Office Math objects. It has added new property UnconditionalMergeFieldsAndRegions in MailMerge class to merge fields and merge regions regardless of the parent IF field’s condition. Previously Aspose.Words used to create random owner password in the produced PDF document when PdfEncryptionDetails.OwnerPassword was not set by the user. There are 85 improvements and fixes in this regular monthly release. such as Animated GIF is fully supported now, MANIFEST.MF updated to support new OSGI versions, TIFF colors accuracy improved, Java 10 and Java 11 compatibility improved: reflection for safe using of optional external libraries is removed, Bookmarks are allowed on block, cell, row level, Added load option to treat Shapes with math XML as Shapes in the model, Provided option to choose between Old and New Mail Merge behaviors, Improved PDF encryption in case when owner password is not specified, Metafile rendering improved: fixed drawing records processing when path bracket is opened, fixed processing of EMR_SETBKMODE record when incorrect values specified, Improved output image quality when rendering metafiles with raster operations set, Fixed handling of glyphs without outlines when parsing glyph data while rendering, Improved rendering of the mathematical element “Apostrophe” of the MathML object, Improved justification of Asian texts, Improved rendering of revisions in balloons, Improved text placement around floating shapes and many more. The list of most notable new and improved features added in this release are given below
Aspose.Words conversion throw error in Docker
Add load option to treat Shapes with math XML as Shapes in the model
Support insertion of Bookmarks at Block, Row and Cell levels
Investigate Aspose.Words for .NET containerization
Provide option to choose between Old and New Mail Merge behaviors
Significant decrease of performance getting bookmark
Table Bookmark gets deleted when importing Table
Incorrect wrapping around a table because of WrapGap issue.
Create tests for API 18.06
AW doesn't move text to the new line for tables with thick borders
Aspose.Words sets owner password when only user password is specified during conversion to PDF
Add unit tests code coverage analysis to development process
Improve table bookmarks
Improve through wrapping of text boxes
Update Manifest generation according to changed packages and new OSGI versions
Ampersand changes alphabetical sort order for INDEX field
Right-aligned tab-stops conversion issue in resultant MHTML
Image sometimes do not render in exported HTML
Math symbols are being read incorrectly
Animated GIF rendered to PDF with a bottom gray band
ReportingEngine.buildReport throws "Multiple decimal separators in pattern "yyyy.MM.dd"
DOCX to PDF conversion issue with image's color
RtfLoadOptions.setRecognizeUtf8Text() does not work
Wrong export declaration in MANIFEST.MF
Docx to Png/Pdf conversion issue with table's autofit behavior
Tables misaligned in rendered PDF
Text at the end of page flows to the next page when saving Word as PDF
Shape's text and color is lost in output PDF/DOC
DOCX to PDF conversion issue with table rendering
Extra lines are rendered after conversion from DOCX to PDF
Size of picture changes after re-saving DOC
Format revisions and comments are not rendered correctly in PDF
Shape's position is changed in output PDF
Empty pages are rendered in output PDF
MACROBUTTON HTMLDirect is not rendered in output PDF
Paragraph floats towards left page margin in PDF
DOCX to PDF conversion issue with shape's position
Trendlines in graphs on word documents not displaying
Formula breaks when document is resaved
MailMergeCleanupOptions.RemoveUnusedFields removes REF field from the footer
Asian text is justified incorrectly
The EQ field does not render in output Jpeg when Document.GetPageInfo is called
Image's content is lost after using Document.AppendDocument
Hidden bookmarks are not correct after re-saving DOCX
The EQ field does not render in output Jpeg
Font name and size is changed after appending one document into another
Vertical spacing not preserved in PDF
Open Save a DOCX causes Tabs to become Underlined
Endnotes becoming corrupted when saving DOC to DOCX
Endnotes becoming corrupted when saving DOC to DOCX
Endnotes becoming corrupted when saving DOC to DOCX
Endnotes Footnotes becoming corrupted when saving DOC
TOC isn't rendered properly in PDF output
Fopc Strict can be written, but reading fails
Chart axis is wrong in Aspose.Words generated .pdf
An error raises while using ComHelper class.
Picture does not render correctly
Picture does not render correctly
Equation is not rendered correctly in PDF
DOCX to PDF conversion issue with cell borders
DOCX to PDF conversion issue with textbox shape glow
Incorrect color of the axis after converting to PDF
Color shade inside the shape is missing in output PDF
Irregular shapes, Missing colors, Incomplete shapes in output PDF
Fill color in shapes is missing in output PDF
Irregular shapes, Missing colors, Incomplete shapes in output PDF
Bookmark position is not preserved during open/save
Table in Shape overlaps the other Page content in fixed page formats
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Words for .NET documentation that may guide users briefly how to use Aspose.Words for performing different tasks like the followings.
Working with Bookmark on Block, Cell, Row Levels
Import Shapes with Math XML as Shapes into DOM
Overview: Aspose.Words
Aspose.Words is a word processing component that enables .NET, Java & Android applications to read, write and modify Word documents without using Microsoft Word. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, TOC updated/rebuilt, Embedded OOXML, Footnotes rendering and support of DOCX, DOC, WordprocessingML, HTML, XHTML, TXT and PDF formats (requires Aspose.Pdf). It supports both 32-bit and 64-bit operating systems. You can even use Aspose.Words for .NET to build applications with Mono.
More about Aspose.Words
Homepage Java Word Library
Download Aspose.Words for Java
Online documentation of Aspose.Words
Post your technical questions/queries to Aspose.Words Forum
Receive notifications about latest news and supported features by subscribing to Aspose.Words Blog
#Animated GIF support#use Bookmarks are Block#Convert EquationXML to Office Math#Switch b/t Old &New Mail Merge#Improved PDF Encryption#Java Word Processing APIs
0 notes
Text
Java 10 Support & Nested Reports Provision by LINQ Reporting Engine inside Java Apps
What's New in this Release?
Aspose development team is happy to announce the monthly release of Aspose.Words for Java 18.8. There are 86 improvements and fixes has included in this regular monthly release, such as Java 10 tested and supported now, New and updated Samples and Examples, Change SHA-1 to SHA-256 and public asymmetric key from 1024 to 2048 for the license mechanism, Implemented support for “underline trailing spaces” compatibility option, Implemented support for paragraph alignment in Omath when inserted using EQ fields, Enhanced computation of interscript spacing values based on TTF properties, Improved wrapping of text around floating objects, Improved calculation of position of floating tables and shapes, Improved floater overlapping logic, Improved computing of pages numbers in continuous sections which have restart attribute and conflicting oddity, Fixed line justification issue when RTL span is at the end of the line, Fixed issue with null dml properties, Fixed issue with rendering of floating shapes in truncated headers/footers, Fixed issue with rendering of lines inside of a field result when updated in truncated part of a cell, Improved rendering of math operators in MathML objects, Improved rendering of MathML objects with n-ary math element when n-ary character and limit location are not specified, Fixed a bug with rendering of a math n-ary element if it is part of a fraction, Fixed a bug when polyline with an arrow and a very small line segment at the end, Fixed a bug when an arrow pointer is incorrectly directed while rendering Bezier curves with arrows, Fixed a bug where the end of the line was outside the “stealth arrow” when rendering, LINQ Reporting Engine supports nested reports. Aspose team has tested Aspose.Words for Java with Java 10 and is pleased to announce that Java 10 is now supported by the latest versions of Aspose.Words for Java. Developers can insert contents of outer documents to their reports dynamically using LINQ Reporting. Starting from Aspose.Words for Java 18.8, developers can enable doc tag to check the template syntax and populate with data using LINQ Reporting. By default, a document being inserted is not checked against template syntax and is not populated with data. It has added support to create snip corner rectangles in this version. This release has added HtmlSaveOptions.ExportCidUrlsForMhtmlResources property. Users can use this property to save the resources of MHTML document using the “Content-Id” URL Scheme. It has also added new property ShowComments in LayoutOptions class. This property is used to show or hide comments in fixed file formats e.g. PDF, XPS. By default, the comments are visible. A new property ShowInBalloons has been added to RevisionOptions class. This property is used to show revisions in the balloons. By default, the revisions in balloons are not shown. Previously, Aspose.Words used to save “@font-face” rules of HtmlFixed documents into a separate file “fontFaces.css” while other CSS declarations were written to “styles.css”. We have changed this behavior and now Aspose.Words saves all CSS rules and declarations into the same file “styles.css”. In case the old behavior is required for compatibility with legacy code, it can be restored by using the new public property HtmlFixedSaveOptions.SaveFontFaceCssSeparately. It has added new property RecognizeUtf8Text in RtfLoadOptions class. This property allows to detect UTF-8 encoded characters and preserve them during import. Obsolete value NumInDash was removed from NumberStyle enum. Please, use NumberStyle.NumberInDash value instead. Obsolete method ToTxt() was removed from Node class. Please, use ToString(SaveFormat.Text) instead. The obsolete property Location has been removed from the FootnoteOptions and EndnoteOptions classes. Please use the Position property. Also, the FootnoteLocation emum type has been removed. The list of most notable new and improved features added in this release are given below
Allow setting "Layout in Table Cell" option of shapes
Add feature to create Snip Corner Rectangle
Track changes rendering issue in resultant PDF
Add a feature to escape ampersand symbol during replacement
Change SHA-1 to SHA-256 and public asymmetric key from 1024 to 2048 for the license mechanism
Add feature to populate template document loaded by "doc" tag
Include Formatting Comments in Save To Tiff
Add feature to detect encoding characters and change them to UFT-8 in output RTF
SaveDate field's result become visible after re-saving the document
Reference resources in MHTML documents using the "Content-Id" URL scheme
Spaces and special characters trimmed when rendering
Remove UTF-8 BOM from CSS parts in MTHML documents
Rework span shallow size tests
Combine styles when saving Words to HTML with HtmlFixedSaveOptions
Incorrect font fallback for Asian characters
Implement the second way of rendering the shape outline
Line Caps Rendering - PolyLine caps direction is not correct
Update minimum possible font size
Remove Aspose logo from Venture license in trial mode
Remove obsolete public properties EndnoteOptions.Location/FootnoteOptions.Location
Set RunPr.ComplexScript to True for Thai letter list labels
SetLicense throws IllegalStateException.
Update Metered license code.
Save HTML to PDF-A_1B does not generate indexed images anymore
Borders look incorrect after converting document to PDF using MS Word or Bullzip PDF Printer
Table with different preferred widths extends outside the page when rendered
Table preferred width no longer automatically resizes when cell preferred width is set
Table column widths are calculated incorrectly during rendering
Cell's contents move to next line after conversion from Doc to Pdf
Elbow Arrow Connectors are not rendering correctly in PDF
Visio objects are overlapped in output PDF
Floating table is positioned improperly
Hijri Date is displayed in English Numbers in output DOCX/PDF
Text is missing after conversion form DOCX to PNG
DOCX to PDF conversion results are inconsistent in Multithreading
DOCX to HTML Issue with HtmlOfficeMathOutputMode as MathML
OfficeMath nodes are exported incorrectly as MathML in output HTML
Image generated from Dokkered web app is completely black.
Thai characters are converted to numbers in PDF
text-anchor' property is not imported correctly
Insert SVG into Aspose.Word.Document results in black image
The rendered PDF output is corrupted
Document.UpdateFields displaces text of frame when using 'IncludeText'
Arrow shape is rendered incorrectly
Numbers List Change while Converting Doc to PDF
Paragraph's text is missing in output PDF
Incorrect rendering of the OMath if FirstLineIndent is specified, after converting to PDF
Problem of incorrect Revisions Count after Comparing documents
CSS border style is not applied to image in output PDF/DOCX
Content is rendered on multiple pages in HtmlFixed/PNG
Distance between symbols not preserved in PDF
Borders of some SmartArt elements not preserved in PDF
LayoutCollector.GetStartPageIndex returns wrong page number
Equations render partially in generated PDF
Document.UpdateFields generates wrong alphabetical sort order for INDEX field
PDF output doesn't match the original DOCX document
Word breaking in Thai language is wrong
Signature images are not visible in generated PDF/Imag
Unknown yellow color rectangle is rendered after conversion from DOCX TO PDF
DOCX to PDF conversion issue with textbox shape glow
StartTrackRevisions hangs and process does not complete
Incorrect rendering of the text outline with zero width after converting to PDF
Extra pages are created when DOCX is converted to PDF
Improve conditions for hanging punctuation
Vertical spacing between Paragraphs increased when rendering to PDF
Remove whitespaces from MathML content while importing html to model.
Line Caps Rendering - Stealth arrow is rendered incorrectly.
Line Caps Rendering - Curved arrow has incorrect direction.
Other most recent bug fixes are also included in this release
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Words for .NET documentation that may guide users briefly how to use Aspose.Words for performing different tasks like the followings.
Inserting Documents Dynamically
Create Snip Corner Rectangle
Overview: Aspose.Words
Aspose.Words is a word processing component that enables .NET, Java & Android applications to read, write and modify Word documents without using Microsoft Word. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, TOC updated/rebuilt, Embedded OOXML, Footnotes rendering and support of DOCX, DOC, WordprocessingML, HTML, XHTML, TXT and PDF formats (requires Aspose.Pdf). It supports both 32-bit and 64-bit operating systems. You can even use Aspose.Words for .NET to build applications with Mono.
More about Aspose.Words
Homepage Java Word Library
Download Aspose.Words for Java
Online documentation of Aspose.Words
Post your technical questions/queries to Aspose.Words Forum
Receive notifications about latest news and supported features by subscribing to Aspose.Words Blog
#Java 10 Support#Nested Reports by LINQ Reporting Engine#Create Snip Corner Rectangle#Reference Resources in MHTML File#Java Word Processing APIs#Show Revisions in Balloons
0 notes
Text
Create, Manipulate & Convert Excel Spreadsheets without using MS Excel in PHP APPs
What's New in this Release?
Aspose team is pleased to announce the first public release of Aspose.Cells for PHP via Java v18.7. The new API incorporates MS Excel data processing and rendering functionalities in PHP (a widely-used open source scripting language). Aspose.Cells for PHP via Java has full functionality of Aspose.Cells for Java with a few limitations, minor API changes and additional requirements. Aspose.Cells for PHP is a subset API that includes all the important and useful features present in its native Aspose.Cells for Java. Aspose.Cells for PHP via Java is equally robust and feature rich component. It supports high-fidelity file format conversions to and from XLS, XLSX, XLSM, SpreadsheetML, CSV, Tab Delimited, HTML, MHTML and OpenDocument Spreadsheet in PHP. The developers will have full programmatic access through a rich APIs set to all MS Excel document objects and formatting that allows to create, modify, extract, copy, merge, and replace spreadsheet content. With Aspose.Cells for PHP via Java, developers can export data, format spreadsheets to the most granular level, create, manipulate and render charts, apply and calculate complex formulas efficiently and much more. The list of most notable new and improved features in this release are listed below
Supports for XLS, SpreadsheetML (XLSX, XML), Comma Separated Value (CSV), HTML, OpenDocument Spreadsheet (ODS), PDF, Tab Delimited, Plain Text (TXT)
Render spreadsheet to vector images (EMF)
Render worksheets to raster images (Multipage TIFF, GIF)
Render worksheets to raster images (PNG, JPEG, etc.)
Render Spreadsheet to PDF with high fidelity
Render spreadsheet to vector images (EMF)
Render worksheets to raster images (Multipage TIFF, GIF)
Render worksheets to raster images (PNG, JPEG, etc.)
Render Spreadsheet to PDF with high fidelity
Copy or move worksheets within or between workbooks
Insert images, Create conventional and custom charts and Set gradient background for charts using API
Add comments to cells
Microsoft Excel 2007/2010 themes and colors
Create auto-filters
Implement data validations
Implement data sorting
Find and replace text
Merge/split Cells
Group/ungroup rows and columns
Create custom page breaks
Calculate complex Excel formulae
Support advanced conditional formatting supported in Microsoft Excel 2007/2010
Freeze/unfreeze Panes
Insert hyperlinks to link data
Implement Smart Markers
Specify document properties settings
Protect/unprotect worksheets
Specify advanced protection options introduced in Excel XP and later versions
Create list object/Microsoft Excel tables
Create subtotals
Insert form controls and other drawing shapes/objects
Create pivot tables and pivot charts
Preserve or remove addin, VBA, macros
Manipulate named ranges
Add, preserve or extract OLE objects from the spreadsheets.
Implement Microsoft Excel sparklines
Apply all characters formatting in the cells including fonts, colors, effects, borders and shading
Apply all the number format settings (supported in Microsoft Excel) for the cells
Set all types of text alignment settings
Apply different kinds of Font Settings for the cells
Apply different colors to cells, fonts, gridlines, graphic objects etc.
Apply different rich text formatting in a single cell
Apply different border settings on cells
Apply different background patterns on cells
Apply Format settings on a worksheet, row, column or a range of cells etc.
Adjust your page orientation, scaling, paper size
Specify your margins and page centering
Create or edit your header and/or footer
Set print area, print titles, or turn on gridlines etc.
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Cells for PHP via Java documentation that may guide users briefly how to use Aspose.Cells for performing different tasks like the followings.
Product Overview
Converting Excel Files to HTML
Overview: Aspose.Cells for PHP
Aspose.Cells for PHP via Java is an Excel Spreadsheet Processing API that allows the developers to add the ability to read, write, convert and manipulate Excel spreadsheets in their on PHP applications while using the JavaBridge. The new API is equally robust and feature rich component. It supports high-fidelity file format conversions to and from XLS, XLSX, XLSM, SpreadsheetML, CSV, Tab Delimited, HTML, MHTML and OpenDocument Spreadsheet in PHP.It is capable of converting spreadsheets to PDF, XPS & HTML formats while maintaining the highest visual fidelity.
More about for Aspose.Cells for PHP
Homepage Aspose.Cells for PHP via Java
Download Aspose.Cells for PHP via Java
Online documentation of Aspose.Cells for PHP via Java
Post your technical questions/queries to Aspose.Cells Forum
#Render spreadsheet to vector images#PHP Excel APIs#Render Spreadsheet to PDF#Copy worksheets between workbooks#Create auto-filters Excel#Create custom page breaks#Excel Files to HTML
0 notes
Text
Aspose.Newsletter August 2018: New APIs for Email Processing, Barcodes Recognition & Other News
Aspose Newsletter for August 2018 has now been published that highlights all the newly supported features offered in the recent releases. It includes information about new APIs for adding email processing capabilities in Python applications, generating & recognizing 1D and 2D Barcodes from images at any angle within Android apps, Launching information about several new APIs, .NET Core support in Aspose.Slides, .NET Standard 2.0 in Aspose.Diagram for .NET, code examples for export header and footer bookmarks from Word to Output PDF in Java & .NET Apps & many more.
Add Email Processing Capabilities in Python Applications
Aspose.Email for Python via .NET API allow developers to embed email related functionality in their Python applications without worrying about the underlying details of message formats. Easily create, manipulate or convert popular email formats including Outlook MSG, EML, EMLX and MHT within Python applications without using Microsoft Outlook. Download Free Trial
Generate and Recognize 1D and 2D Barcodes from Images at any Angle within Android Apps
Aspose.BarCode for Android via Java empowers Android application developers to generate and recognize 55+ barcodes of different types within their applications. Easily manipulate the appearance of the generated barcodes such as background color, bar color, image quality, rotation angle, x-dimension, captions, size, resolution and much more. Download Free Trial
Launching Soon: Aspose.Zip for .NET
Aspose.ZIP for .NET API is soon to be launched that will allow .NET application developers to embed files and folders compression and decompression functionality in their applications. Create zip archives from folders and password protect .zip files using traditional as well as AES encryption. Read more details
Launching Soon: Aspose.EPS for .NET
Aspose.EPS for .NET is a new product going to be added within Aspose file format APIs. This API is mainly aimed at performing conversion operations: convert PS and EPS files directly in PDF documents and vice versa. You can also read PS an EPS files and convert PostScript operators directly into PDF operators. Read more details
Launching Soon: Aspose.XPS for .NET
Aspose.XPS for .NET is another new API to be released very soon. This library is intended to perform conversion of XPS documents into other file formats. However, in the first release, it will offer features related to creating, editing and saving XPS documents within all types of .NET Applications (Widows Forms Application, Console Applications, ASP.NET Web Applications). Read more details
Launching Soon: Aspose.PSD for .NET
Aspose.PSD for .NET is almost ready for public launch. The PSD API will allow an extensive manipulation of PSD file formats without requiring Adobe Photoshop to be installed. .NET developers can also edit PSD files, update layer properties, add watermarks, perform graphics operations or converting one file format into another. The PSD API is written in managed C# and can be used with any kind of application from ASP.NET web applications to Windows desktop applications. Read more details
Support for .NET Core available in Aspose.Slides
Aspose.Slides for .NET is an award-winning PowerPoint presentations processing solution that enables to read, write, modify and convert PowerPoint presentations from within any type of .NET applications. The new version now supports .NET Standard 2.0 (.NET Core) Framework along with plenty of new features. Read more
Support for .NET Standard 2.0 in Aspose.Diagram for .NET
.NET developers can confidently use Aspose.Diagram for .NET API now within their .NET Core applications to work with Visio file formats. It allows you to create, edit, manipulate and transform Microsoft Visio® diagrams to XPS, HTML, SVG, SWF, XAML, images or PDF formats within any type of .NET application. Read more details here.
Code Example: Export Header and Footer Bookmarks from Word to Output PDF
In some certain scenarios, Word documents have more than one sections that contain bookmarks in the header or footer. Aspose.Words supports this feature in .NET and Java applications to control how header and footer bookmarks are exported in PDF file.
Code Example: Manipulate Slicers in Microsoft Excel Files
Slicers in Excel file are used to filter pivot data quickly. Whenever, Slicer buttons are selected or deselected, it shows the current filtering state that helps the user to understand what precisely has been filtered in the Pivot Table. Aspose.Cells now supports to create, manipulate and render Slicers in the spreadsheet within .NET, Java and Android via Java applications
Code Example: Extract Highlighted Text from PDF Documents in .NET
Aspose.Pdf for .NET API already supports extracting text from PDF documents based on some specific regular expressions or by specifying a string to be searched. Now using TextMarkupAnnotation.GetMarkedText() and TextMarkupAnnotation.GetMarkedTextFragments() methods in API, users can easily extract highlighted text from PDF document. Read more details
Code Example: Convert PDF to Excel XLSX Format in Java
Aspose.Pdf for Java already supports converting PDF files to XLS as well as other document formats. This new version now enables Java developers to easily convert PDF to XLSX format using setFormat() method of ExcelSaveOptions class. Read more
Code Example: Add Extended Attributes to Resource Assignments in a Project File
Aspose.Tasks for Java API already had the capability to add extended attributes to tasks and resources in a project file. Now it supports to add extended attributes information to resource assignments as well. Extended attributes can be added to resource assignments as plain as well as lookup values. Read more details
Code Example: Extract ICC Profiles, and Saving EMF and EMF+ Format to File in .NET
An ICC profile is a set of data that characterizes a color input or output device, or a color space. Using Aspose.Imaging – developers can extract ICC profiles from images from within .NET and Java applications. It also supports converting EMF and EMF plus graphic format to file.
Code Example: Import Siemens JT version 9 and Convert to 3D File Formats in .NET and Java
Using Aspose.3D for .NET API – developers can import and convert version 9 of Siemens JT files to the supported 3D formats (FBX, STL, WavefrontOBJ, Discreet3DS, Universal3D, Collada, glTF, GLB, Draco, GLTF, RVM). Read more details.
Updates about new Product Releases
Aspose.Total for .NET - a compilation of Aspose latest .NET products
Aspose.Total for Java – a compilation of Aspose latest Java products.
Aspose.Total for Android – all the latest versions of Aspose Android APIs.
Aspose.Total for SharePoint – a compilation of Aspose latest SharePoint products.
Aspose.Total for Reporting Services– a compilation of Aspose latest Reporting Services products
Aspose.Total for JasperReports – The latest versions of Aspose JasperReports products.
Aspose.Total for C++ – The latest versions of our C++ products packaged into one product suite.
Aspose.Words for SharePoint 18.6 – Improved rendering of DrawingML chart data labels with percentage values and the specified format.
Aspose.Pdf for Android via Java 18.6 – Support for Metered License and inter-file format Conversion.
Aspose.Slides for SharePoint, Reporting Services and JasperReports 18.6 – Presentation rendering and export to PDF and slide thumbnails has been Improved.
Aspose.Words for Reporting Services 18.6 – Upgraded Aspose.Words for Reporting Services to Latest Version of Aspose.Words for .NET 18.6.
Aspose.Slides for Java 18.6 – Improved bubble and chart axes management support in Aspose.Slides.
Aspose.Words for JasperReports 18.6 – Upgraded Aspose.Words for JasperReports to Latest Version of Aspose.Words for Java 18.6.
Aspose.Slides for C++ 18.6 – Improved chart management support available in Aspose.Slides.
Supporting User Groups and Conferences
Aspose is sponsoring a number of user groups and upcoming events, including:
August 04: DDD Perth – Perth, Australia
August 18: DDD Sydney – Sydney, Australia
Sponsor a user group? Get in contact: [email protected]
Collect a copy of Aspose Newsletter, July 2018 edition
Collect the English version of this newsletter
#python APIs email processing#Recognizing Barcodes in Android Apps#Launching information of many APIs#.NET Core available#.NET Standard 2.0 support#Manipulate Slicers in Excel Files#Convert PDF to Excel XLSX Java
0 notes
Text
Aspose.Newsletter June 2018: Updates to Aspose Privacy Policy & Building BEST Word Processing Apps
Aspose Newsletter for June 2018 has now been published that highlights all the newly supported features offered in the recent releases. It includes information about Programmatically perform advance Word document manipulation tasks without using Microsoft Word, Updates to Aspose Privacy Policy, Support for .NET Standard 2.0 in Aspose.HTML for .NET & Aspose.BarCode for .NET, Microsoft Office 2016 charts support included in Aspose.Slides, LINQ reporting engine supports Null-Conditional operators in Template Expressions & many more.
Build the BEST Word Processing Apps using the Best Microsoft Word Compatible APIs for Any Platform
Programmatically perform advance Word document manipulation tasks without using Microsoft Word. Aspose.Words Product Family includes individual APIs for .NET, Java Android and SharePoint. Also export reports from JasperReports and SQL Server Reporting Services to Word document formats. It supports DOC, DOCX, RTF, XML, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents directly within your applications. Download Free Trial.
Privacy and Terms and Conditions Changes
In line with EU data protection law changes we’ve updated our Privacy Policy and Terms of use. We’ve made these updates to ensure our terms are easier to understand, more transparent and in keeping with international privacy standards. There is no action required from your end, we just wanted to let you know about these changes. As always, to update your newsletter preferences either change the settings against your Aspose account or use the unsubscribe link at the bottom of this email. If you have any questions about these changes, please reach out to us through the contact information homepage.
Launching Soon: Aspose.Email for Python via .NET Core
Good news for Python application developers who would love to incorporate email processing and communication related functionality in their applications. Aspose.Email for Python via .NET Core is soon to be launched and it will include full functionality of Standard .NET Framework of API with just a few exceptions. Read more details here
Support for .NET Standard 2.0 in Aspose.HTML for .NET
Aspose.HTML is a cross-platform class library that enables you to perform a wide range of HTML manipulation tasks directly within your .NET applications. The new version of Aspose.HTML for .NET now supports .NET Standard 2.0 (.NET Core) Framework. It allows parsing of HTML5, CSS3, SVG and HTML Canvas to construct a Document Object Model (DOM) based on the official W3C specification. Read more detail
Support for .NET Standard 2.0 in Aspose.BarCode for .NET
Aspose.BarCode for .NET brings exciting feature of support for .NET Standard 2.0 (.NET Core). We have ported complete functionality of regular .NET version of Aspose.BarCode into .NET Standard 2.0 version with just a few limitations. Read more details
Support of Microsoft Office 2016 Charts included in Aspose.Slides
Aspose.Slides offers standalone PowerPoint presentations processing APIs to read, write, manipulate & convert PowerPoint slides. The latest version supports MSO 2016 charts within any type of .NET, Java, C++ and SharePoint applications as well as SSRS and JasperReports exporters. Developers can now create charts in an easy way within PowerPoint slides namely: Histogram, Picture Organization, Tree Map, Box and Whisker, Funnel and Sunburst charts.
LINQ Reporting Engine Supports Null-Conditional Operators in Template Expressions
Aspose.Words adds new feature in LINQ Reporting Engine to support pre-defined null-conditional (A?.B) and null-coalescing (A ?? B) operators in template expressions within .NET, Java, and Android via Java applications. The engine also enables users to use lifted operators in template expressions. More
How to: Create and Manipulate Microsoft Excel Charts and Shapes in C++ Applications?
Aspose.Cells for Android via Java finds the children pivot tables of a parent pivot Aspose.Cells for C++ supports creating and manipulating charts and shapes in XLS, XLSX, XLSM and XLSB file formats. C++ developers can visualize information in charts just as Microsoft Excel does. Creating charts at runtime, based on the data in a spreadsheet, is one of Aspose.Cells’ demanding feature. Aspose.Cells supports to create both Standard and Customized charts. Try out fully functional code examples
How to: Convert PDF to HTML using Aspose.Pdf Java API?
For some particular PDF documents (i.e. containing images and annotations), Aspose.Pdf API was taking more time than expected in order to render PDF files as HTML. However, we have improved API for such type of conversions and processing time is much reduced. Try out fully functional code examples
How to: Read or Write TSV (Tab-Separated Values) Files in .NET and Java Applications?
TSV files are used to contain spreadsheet data but without any formatting. The format is same with Tab Delimited where data is arranged in rows and columns such as tables and spreadsheets. Aspose.Cells does support to read and write TSV file format type, it includes relevant member (TSV) in both LoadFormat and SaveFormat Enumerations. Try .NET and Java sample code within your personalized applications now:
How to: Export PNG and JPEG to PDF in Aspose.Imaging for Java?
Using Aspose.Imaging for Java – developers can convert PNG, JPEG and BMP to PDF format. It provides an Image class to load PNG or JPG files and same can be used to convert images to PDF format. Try out fully functional code examples.
Updates about new Product Releases
Aspose.Total for .NET - a compilation of Aspose latest .NET products
Aspose.Total for Java – a compilation of Aspose latest Java products.
Aspose.Total for Android – all the latest versions of Aspose Android APIs.
Aspose.Total for SharePoint – a compilation of Aspose latest SharePoint products.
Aspose.Total for Reporting Services– a compilation of Aspose latest Reporting Services products
Aspose.Total for JasperReports – The latest versions of Aspose JasperReports products.
Aspose.Total for C++ – The latest versions of our C++ products packaged into one product suite.
Aspose.Words for SharePoint 18.4 – Improved rendering to PDF, Pie Chart, WordArt objects and MathAccentElement.
Aspose.Pdf for C++ 18.4 – Improvements in Internal code and system classes of Aspose.PDF for C++.
Aspose.BarCode for .NET and SSRS 18.5 – Improved barcode generation process in .NET and SQL Server Reporting Services.
Aspose.Pdf for Java 18.3 – Improved and Enhanced Java Library to Create and Manipulate PDF Documents.
Aspose.Words for Reporting Services 18.4 – Upgraded Aspose.Words for Reporting Services to the latest version of Aspose.Words for .NET.
Aspose.BarCode for Java, SSRS and JasperReports 18.4 – Upgraded exception handling in Aspose.BarCode API.
Aspose.Email for .NET and Java 18.4 – API functionality has been improved as result of several bug fixes.
Aspose.Diagram for .NET and Java 18.4 – Enhanced cloning of Shape and connecting Visio Shapes by connection indexes.
Aspose.Words for JasperReports 18.4 – Upgraded Aspose.Words for JasperReports to the latest version of Aspose.Words for Java.
Aspose.Tasks for .NET 18.5 – Metered Licensing is now supported for those customers who want to be billed based on the usage of the API features.
Aspose.3D for .NET 18.4 – Enhanced import and export of Collada and add Vertex element to Mesh.
Aspose.Tasks for Java 18.4 – Improved project recalculations further to enhance the API functionality.
Supporting User Groups and Conferences
Aspose is sponsoring a number of user groups and upcoming events, including:
June 16: Queensland Global DevOps Bootcamp – Brisbane, Australia
Sponsor a user group? Get in contact: [email protected]
Collect a copy of Aspose Newsletter, February 2018 edition
Collect the English version of this newsletter
#Build BEST Word Processing Apps#Microsoft Word Compatible APIs#Support for .NET Standard 2.0#Microsoft Office 2016 Charts support#LINQ Reporting Engine Supports#Manipulate Excel Charts in C++#Convert PDF to HTML in Java
0 notes
Text
Set Margins of a Shape & Parsing Pivot Cached Records while Loading Excel File in Android Apps
What’s new in this release?
Aspose development team is pleased to announce the new release of Aspose.Cells for Android via Java 18.3.0. This release includes many new features, enhancements and other bug fixes that further improve the overall stability and usability of the API. Sometimes, one pivot table uses other pivot table as a data source, so it is called a child pivot table or nested pivot table. Developers can find the children pivot tables of a parent pivot table using the PivotTable.getChildren() method. The following sample code finds the children pivot tables of the pivot table using the PivotTable.getChildren() method and then refreshes them one by one. When users create a Pivot Table, Microsoft Excel takes a copy of the source data and stores it in the Pivot Cache. The Pivot Cache is held inside the memory of Microsoft Excel. When Developers load your Excel file inside the Workbook object, you can decide whether users also want to load the records of Pivot Cache or not, using the LoadOptions.ParsingPivotCachedRecords property. The default value of this property is false. If Pivot Cache is quite big, it can increase the performance. When Microsoft Excel file is exported to HTML using Microsoft Excel or Aspose.Cells APIs, it also exports various types of Document, Workbook and Worksheet properties. You can avoid exporting these properties by setting the HtmlSaveOptions.ExportDocumentProperties, HtmlSaveOptions.ExportWorkbookProperties and HtmlSaveOptions.ExportWorksheetProperties as false. Microsoft Excel file may contain many unnecessary unused styles. When users export the Excel file to HTML file format, these unused styles are also exported. This could increase the size of HTML. Users can exclude the unused styles during the conversion of Excel file to HTML using the HtmlSaveOptions.ExcludeUnusedStyles property. Early versions of Aspose.Cells were not able to handle automatic units of chart axis properly when chart is rendered to image or pdf. Now, Aspose.Cells supports the handling of automatic units of chart axis. There is no code change. Just convert your chart into image or pdf and it will render chart axis just like Microsoft Excel renders it. Earlier, Aspose.Cells would create PdfBookmarkEntry for normal sheet. But now Aspose.Cells can also create PdfBookmarkEntry for chart sheet. Since, chart sheet does not have any other cell except cell A1, so it will create PdfBookmarkEntry for cell A1 only. Aspose.Cells allows users to set the margins of any shape or comment using the Shape.TextBody.TextAlignment property. This property returns the object of ShapeTextAlignment class which has different properties e.g. TopMarginPt, LeftMarginPt, BottomMarginPt, RightMarginPt etc. that can be used to set the top, left, bottom and right margins. Users can specify formula fields when you import data into your worksheet using the ImportTableOptions.setFormulas() method. This method takes the Boolean array where the value true means the field is a formula field. For example, if the third field is a formula field, then third value in the array will be true. Aspose.Cells provides the Workbook.Settings.MaxRowsOfSharedFormula property that can be used to specify the maximum rows of the shared formula. The shared formula will be split to several shared formulas if the total rows of shared formula is greater than it. Sometime, an Excel file contains external resources e.g. linked images etc. Aspose.Cells allows users to control these external resources using Workbook.Settings.StreamProvider which takes the implementation of IStreamProvider interface. Whenever users will try to render your worksheet containing external resources e.g. linked images, the methods of IStreamProvider interface will be invoked which will enable users to take appropriate actions for their external resources. Aspose.Cells allows users to filter or remove defined names present inside the workbook. Microsoft Excel allows users to group pivot fields in the Pivot Table. When there is large amount of data related to a pivot field, it is better to group them into sections. Aspose.Cells provides this feature via the PivotTable.setManualGroupField() method. This was a long-awaited feature requested by many users. Microsoft Excel also supports dashed border types which are not supported by most web browsers. When users convert such an Excel file into HTML using Aspose.Cells, the borders are removed. However, Aspose.Cells allows users to accomplish the task and supports to display such borders with HtmlSaveOptions.ExportSimilarBorderStyle property. Dialog sheet is an older format that contains a dialog box. You can find if a sheet is dialog or some other type with Worksheet.Type property. If it returns enumeration value SheetType.DIALOG, then it means, you are dealing with Dialog sheet. Microsoft Excel allows users to change the display label of the Ole Object. Users can also access or modify the display label of the Ole object via Aspose.Cells APIs using the OleObject.Label property. When users put some value inside a cell that has leading apostrophe or single quote mark, then Microsoft Excel hides it, but when users select the cell, it displays the leading apostrophe or single quote in a formula bar. Aspose.Cells provides StyleFlag.QuotePrefix property that will handle either preserving the quote or not preserving the quote for their needs. Users can read axis labels of a chart after calculating its values using the Chart.calculate() method. Please use the Axis.AxisLabels property for this purpose that will return the list of axis labels. This release includes plenty of improved features and bug fixes as listed below
Provide an option to decide whether exporting workbook properties
Provide an option to decide whether exporting document properties
Create a PdfBookmarkEntry for a chart sheet
Add LoadDataFilterOptions.NAMES constant to filter defined names when loading workbook
PdfSaveOptions.DrawObjectEventHandler is needed just like ImageOrPrintOptions.DrawObjectEventHandler
Extract label name that can be set for Package Objects embedded in Excel file
Observe very slow filtering in Microsoft Excel 2013 and 2016 when filter is applied
Fix needed for all ActiveX controls
Exclude unused styles when exporting Excel file to HTML (parent issue id: CELLSJAVA-42471)
How to identify worksheet shapes via DrawObjectEventHandler
Unable to access horizontal category axis labels items
Parts of images are truncated or missing and they do not match with original source images
Image protrudes from the shape in the output PDF
Element shape is incorrect in the output HTML
Excel to Html - Wrapping text is ignored
XLSB file gets corrupt after opening and saving
HTML output discrepancy - Issue with spaces
Irrelevant data included when saving to HTML
XLSB corrupted after re-saving
15 digits numbers do not match what is in MS Excel
Margins and layout differences when comparing the output PDF (by Aspose.Cells) with the MS Excel generated PDF
Feature does not work in Java - ResultSet
Sheet1 shapes are lost and Stars in Sheet2 are rounded
Invalid encoding - Exception occurs on loading the Excel file
Macro and Dialog sheets are detected as regular worksheets
MS Excel does not allow to save XLS file again
Aspose.Cells is not filtering data correctly instead it hides all the rows
Output HTML does not match with Excel
Excel files corrupted after open/save by Aspose.Cells APIs
Extra columns are coming at the end of each row in the output HTML for a range
Excel file is corrupted and have some cells changed after saving
Calculation errors are present in the hidden sheet namely KD020
ImportTableOptions.setInsertRows() is not working while importing the ResultSet to worksheet
Comments attached to the cells (in the template file) are not shown when importing the Excel file into GridWeb
Inconsistent cell coordinates reported by ImageOrPrintOptions.DrawObjectEventHandler
Borders of rows are misaligned in the output PDF
X-Axis scale is incorrect in PNG output of Excel chart
Rendering of the chart is not correct in the output PDF
Chart is replaced with Red X when converting XLSX to ODS
Images lost when converting ODS to XLSX
Properties are not extracted from XLS and XLSX files
Saving XLS to XLSB removes allowEditRanges
Exception "NullPointerException" occurred when extracting SmartArt shape text
Article Code - Control External Resources using WorkbookSetting.StreamProvider - does not work for Java
Article Code - Specify Formula Fields while Importing Data to Worksheet - does not work for Java
Chinese characters in embedded file name (title) is not well-displayed in notepad
Other most recent bug fixes are also included in this release.
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Cells for Android documentation that may guide users briefly how to use Aspose.Cells for performing different tasks like the followings.
Export Document Workbook and Worksheet Properties in Excel to HTML conversion
Parsing Pivot Cached Records while loading Excel file
Overview: Aspose.Cells for Android
Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.
More about Aspose.Cells for .NET
Homepage of Aspose.Cells for Android
Download Aspose.Cells for Android
Online documentation of Aspose.Cells for Android
#Parsing Pivot Cached Records#Excel to HTML conversion#Group Pivot Fields in the Pivot Table#Set Margins of Comment or Shape#Java Android Excel API#Export similar Border Style
0 notes
Text
Convert PDF File to Excel Format, Manipulate Tables in Existing PDF in Android Apps
What's New in this Release?
Aspose development team is excited to announce the release of Aspose.PDF for Android via Java17.12.0..It has been released for android platforms and ready to be used in Android Applications. It offers the feature to search and parse simple tables which already exist in PDF document. This new feature in the API has come with the addition of new class com.aspose.pdf.TableAbsorber which provides the capabilities to search and manipulate the tables in PDF documents. The usage of TableAbsorber is very much similar to existing TextFragmentAbsorber Class. This release has implemented support for gradient color in Aspose.PDF for Android via Java 17.12, in order to apply gradient color to the Graph. The feature can be used with new property PatternColorSpace and class GradientAxialShading which has been added into com.aspose.pdf.drawing Package. The code snippet on blog announcement page demonstrates the usage of new added properties and classes, in order to apply gradient color. Since Inter-File Formats Conversion has been an interesting feature of the APIs offered by Aspose – Aspose team has added support to convert PDF file into Excel format. This new release of the API offers two different methods which can be used according to users requirements regarding conversion, Using com.aspose.pdf.SaveFormat Class and Using ExcelSaveOptions Class. Along with the new features, which have been shared above, it has also made some bug fixes in this release of the API – which can be seen in release notes section of the API documentation. Some important features and enhancements included in this new release are listed below
Implementation com.aspose.pdf.TableAbsorber
PDF to EXCEL conversion support
Handle extracted text based on columns
PatternColorSpace support in new generator
Checking the status of Concatenation
java.lang.NullPointerException when creating com.aspose.pdf.engine.commondata.text.segmenting.TextSegmenter
Adopted TextFragmentCollection for Java Iterable interface"
Pdf to text: space between text increased
The extracted text from pdf is incorrect
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Pdf for Android documentation that may guide users briefly how to use Aspose.Pdf for performing different tasks like the followings.
Convert PDF File to Excel format
Convert PDF File to EPUB
Overview: Aspose.Pdf for Android
Aspose.Pdf for Android is a PDF document creation & manipulation c omponent that enables Android applications to read, write & manipulate PDF document without using any other third party application. It allows PDF compression options, table creation & manipulation, support for graph objects, extended security controls, custom font handling, add or remove bookmarks, create table of contents, add, update, delete attachments & annotations, import or export PDF form data, print PDF docs & much more.
More about Aspose.Pdf for Android
Homepage of Aspose.Pdf for Android
Download Aspose.Pdf for Android
Read online documentation of Aspose.Pdf for Android
#Convert PDF File to Excel#Manipulate Tables in existing PDF#Apply Gradient Color#Android PDF APIs#Improved Pdf to text#Handle extracted text based on columns#Android PDF library
0 notes
Text
Preserve Meta-Characters during Replacement & Enhanced LINQ Reporting Engine inside Java Apps
What's New in this Release?
Aspose development team is happy to announce the monthly release of Aspose.Words for Java 18.1.0. There are 63 improvements and fixes in this regular monthly release. The most notable includes improved character spacing control logic, improved space shrinking for Verdana font, improved “allow handing punctuation” handling when kerning is enabled, Fixed clip issue with semi-broken tables, Fixed draw order of wrapped shapes in 2013 mode, Fixed repeated header height problem during field update, Fixed the bug causing error in page numbers in multi-page documents rendered into PostScript, Proper calculation of undocumented margins in DrawingML Charts implemented, Horizontal axis of Bubble Chart scaling fixed, Vertical axis of 3DArea Chart scaling fixed, MS Word 2016 approach for rendering of DrawingML Charts axis labels implemented; (Labels are rotated to fit the chart), Fixed rendering of Legend markers for 3D-LineChart, Improved rendering of composite (with multiple series) charts and Chart title with ManualLayout rendering fixed. This release has enhanced the support of data band inside a single-column table row for LINQ Reporting Engine. In previous versions of Aspose.Words, when opening and closing foreach tags are inside same cell, the output contents would be in the same cell. Starting from Aspose.Words 18.1, users can export the single-column data band in separate new row using greedy switch. This has enhanced the support of conditional blocks in table’s row for LINQ Reporting Engine. If users put an opening if, elseif, or else tag and a closing if tag in the same cell, the engine treats a template option formed by these tags as a common one rather than a table-row one by default. However, users can override this behavior making the engine to treat such a template option as a table-row one by specifying a greedy switch. It has added FindReplaceOptions.PreserveMetaCharacters property in Aspose.Words 18.1 to preserve meta-characters beginning with “&” during replacement. In this release, Aspose team has removed following obsolete public method from CompositeNode class. The parameter “isLive” is not used anymore. Please use CompositeNode.GetChildNodes(NodeType nodeType, bool isDeep) instead. It has added new feature in the release of Aspose.Words to show or hide the chart axis. You can use ChartAxis.Hidden property to achieve this. XmlMapping.StoreItemId property has been added in this release to specify the custom XML data identifier for the custom XML data part. Please read DataBinding class for more detail about storeItemID property. The list of new and improved features added in this release are given below
Add feature to show/hide axis of chart
API to get geometric position of element in Word Doc
Add feature to get w:storeItemID of StructuredDocumentTag
Add feature to add multiple replies to comment using Comment.AddReply
RTF to Pdf conversion issue with text-box position
Empty row gets added when closing tag <</foreach>> is in last row of table
Incorrect ChartDataPoint Cloning
Some headers/footers have height of 0 in XMLs obtained by internal layout API
Rework Pdf digital signing code to be compatible with NetStandart 2.0
The length of superscripted footnote's text is incorrect in RTF output.
Shape is not rendered correctly in output PDF
Cleen up System.Security.Cryptography.Xml.
Removed Aspose.Xamarin.Security project.
Gradient fill image is filled as solid fill in PDF
Thai words are showing as squares when converted to DOC.
Document.UpdateFields does not update LastSavedTime.
Bullets rendering issue on Linux
Header contents are overlapped with body contents after conversion from Docx to Pdf
Content overlaps footer
Right borders specified for "tr" or "tbody" elements are not applied to cell
ReplacingArgs.Replacement returns incorrect value
Scaling issue of charts in DOCX to PDF conversion
Difference in values of axis in DOCX to PDF rendering
Barcode images are missing upon RTF conversion
DOCX to PDF conversion loses some images
Font information garbled in RTF document
White Paragraphs in Cells Turn Black during Saving a RTF
Incorrect TOC page number in RTF to DOCX conversion
Incorrect TOC page number in RTF to DOCX conversion
System.NullReferenceException is thrown when RevisionOptions.ShowRevisionBalloons is set to true
Repeating Section Content Control is not rendered in output PDF
RTF to DOCX conversion issue for Footnote Words Become Superscript
Incorrect rotation of the X-axis label text when exporting to PDF
Legend markers for 3D-LineChart are rendered incorrectly when exporting to PDF
Incorrect TOC page number in RTF to DOCX conversion
Error in page number when converting to PostScript
Range.Replace text within GroupShape does not Replace
DOCX to HTML conversion issue with chart rendering
OfficeMath is changed after re-saving DOCX
AllowHangingPunctuation rule is improperly processed
When open DOCX file, an exception occurs
Html save as Odt - view of table is different than in Docx and in MS Word
Document.Compare returns incorrect revisions
Incorrect TOC page number in RTF to DOCX conversion
Other most recent bug fixes are also included in this release
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Words for .NET documentation that may guide users briefly how to use Aspose.Words for performing different tasks like the followings.
Working with Table-Row Data Bands
Working with Table-Row Conditional Blocks
Overview: Aspose.Words
Aspose.Words is a word processing component that enables .NET, Java & Android applications to read, write and modify Word documents without using Microsoft Word. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, TOC updated/rebuilt, Embedded OOXML, Footnotes rendering and support of DOCX, DOC, WordprocessingML, HTML, XHTML, TXT and PDF formats (requires Aspose.Pdf). It supports both 32-bit and 64-bit operating systems. You can even use Aspose.Words for .NET to build applications with Mono.
More about Aspose.Words
Homepage Java Word Library
Download Aspose.Words for Java
#Show Hide Chart Axis#Single-Column Table Data Bands#Conditional Blocks for LINQ Reporting Engine#Preserve Meta-Characters During Replacement#Java Word Processing#DOCX to HTML conversion
0 notes
Text
Working with Conflict Pages & Enhanced Loading Attached OneNote Files inside Java Apps
What’s new in this release?
Aspose development team is very excited to announce the new release of Aspose.Note for Java 17.11.0. This release enhances the capability of working with pages from a Notebook document for manipulating Conflict Pages. It also brings improvements to the API in terms of bug fixes that further adds to the stability of the API functionality. This release of API provides an enhancement where a page version from history can be identified as conflict page. Conflict pages are skipped by default while saving the file. Using the API, if it is marked as non-conflict using the isConflictPage method, it will be saved as usual one in the history without being ignored as shown in the code sample on blog announcement page. Bellows is the list of new and enhanced features included in this new release.
Page size is reset to Auto after document saving
Page metadata node is missed exception is raised while loading attached onenote files
Exception raised while loading the attached one note file
API shows incorrect number of pages in the document
Page history is not accessib
Newly added documentation pages and articles
Some new tips and articles have now been added into Aspose.Note for Java documentation that may guide users briefly how to use Aspose.Note for performing different tasks like the followings.
Working with Conflict Pages
Printing Documents
Overview: Aspose.Note for Java
Aspose.Note is a feature-rich Java class library that enables java applications to programmatically interact with OneNote documents without requiring MS Office OneNote having installed on the server. This Java API empowers developers to Create, Read, Export and Manipulate the contents of the Microsoft OneNote file format by working with attachments, text, hyperlinks, tables, tags and text styles. Easily extract images from OneNote documents and convert them to PDF, BMP, JPG, GIF and TIFF image formats.
More about Aspose.Note for Java
Homepage of Aspose.Note for Java
Download Aspose.Note for Java
Online documentation of Aspose.Note for Java
#Conflict Pages Manipulation#loading attached OneNote files#Working with Conflict Pages#Page size is reset to Auto#Page metadata node#Java OneNote API#Manipulate OneNote online files
0 notes