Upgrading

ABCpdf .net

 
   

 

   
Basics  

ABCpdf 10 is a new version completely independent of the old. It incorporates the ABCpdf2, ABCpdf3, ABCpdf4, ABCpdf5, ABCpdf6, ABCpdf7, ABCpdf8 and ABCpdf9 namespaces so that you can upgrade with minimal changes to your code. When you want to take advantage of the new features, simply reference the new name.

Simply replace...

[C#]
using WebSupergoo.ABCpdf9;

[Visual Basic]
Imports WebSupergoo.ABCpdf9

with...

[C#]
using WebSupergoo.ABCpdf10;

[Visual Basic]
Imports WebSupergoo.ABCpdf10

Unless you have side-by-side versioning (available in Windows XP), you will not be able to have multiple versions of ABCpdf installed in the GAC. In this case, you should install the relevant assemblies in the bin directories of your application.

 

   

Changes
 

ABCpdf is fully backward compatible. Although extensive changes have been made to the core engine, we check that these changes produce results that are compatible with previous versions.

There are some minor differences in types between the ABCpdf9 and ABCpdf10 namespaces.

The XColor.ColorSpace property has been changed from an integer to an enum. However since the new enum values are the same as the old integer values you can just cast between the two. See the XColor.ColorSpace property for details and examples.

There are some minor stylistic differences between best practice in the old and new namespaces. Any detected issues will result in a compile time warning and a suggestion for a substitute line of code. We would recommend that you make these changes but you are safe to ignore the warnings if you do not have time to do so.

There are some minor differences in behavior between the ABCpdf9 and ABCpdf10 namespaces. These differences are improvements but if you have been relying on the old behavior you may wish to disable them.

Kerning is enabled for higher quality text output. However it does mean that the positioning of letters in text inserted using methods like AddText and AddHtml, may be slightly different. If you have been relying on exactly the same positioning you will want to use the following line of code after creating any Doc object.

doc.TextStyle.Kerning = KerningType.None;

Images are now always inserted at the size that is specified. In earlier versions of ABCpdf, if the width or height of the destination rectangle was zero, the rectangle was expanded to insert them at 72 DPI. This was not logical or intuitive behavior but if you have been relying on it you will want to use the following line of code after creating any Doc object.

doc.SetInfo(0, "AutosizeImages", 1);

TIFF orientation tags are supported. This means that images with these tags will automatically be presented the right way up. However if you have been processing these tags yourself you may wish to disable this behavior. Simply use the following line of code after creating any Doc object.

doc.SetInfo(0, "AutorotateTIFFImages", 0);

PDF Portfolios are now, by default, opened the way a user would see them when opening them in Acrobat. If you have written custom code to extract individual PDFs from a portfolio you will need to set the XReadOptions.OpenPortfolios property to false before reading them in. You will probably just need to use the following line of code after creating any Doc object.

doc.ReadOptions.OpenPortfolios = false;

Color components in the XColor object used not to accept values outside the legal limits. In line with Microsoft best practice, this has been changed so that you can store values outside the legal range. The advantage of this is that, say, you might want to store values between 0 and 65535 and then later scale them down to 0 to 255 before using them for PDF drawing. If your code results in illegal color values at the point of drawing, then this change may result in a change in behavior. In the past illegal values would be likely to result in randomly colored objects. In the ABCpdf10 namespace illegal values are likely to result in black, white or invisible objects. If you see this type of symptom you should be looking for a bug in the way you assign color values in your code. Alternatively you can just change your code to use the behavior in the old namespace. To do this for grayscale and RGB values you need to modulus your values with 256 at the point of assignment. For CMYK values you need to pin them from 0 to 100 at the point of assignment.

The TextStyle.String property has been updated to reflect various state properties which had been left out in earlier versions. If you are using the TextStyle.String to store state, this should mean that your code will now store all TextStyle state rather than just a part of it.