Posts

Showing posts from 2011

How To call Java Jar from C# Code

First I will say how to create a jar file for given java package using command prompt You can create Manifest file using note pad by including below mentioned contents                        Manifest-Version: 1.0                        Main-Class: Main Here manifest file is named as manifest.mf Here Main is the main class of the java project. In my example java project it only contains Main.java with below code.                                        public class Main {                   ...

How to set and get Metadata to image using BitmapMetadata class in C#

When images are considered, those are storing their Meta data using different types of Meta containers such as EXIF, Adobe XMP, IPTC, Photoshop Image resource and Text descriptions. This every container has their specific unique rules to encode (store) and decode (extract) Meta data. As well as these each Meta container is storing specific Meta information. Exif Meta containers are mostly storing location information and GPS (Global Positioning System) records. As well as, Adobe XMP is responsible to store Dublin core Meta data which provides standard Meta tags that can be used to describe digital objects basically and IPTC is storing Meta information about application records. Meta data extractor is mainly considering these Exif, IPTC and adobe XMP Meta containers when it is extracting Meta data from images. As well as, these different Meta data containers are considered; they are structuring Meta tags in different dir...

How to add standard and custom Metadata to PDF using iTextSharp

In a previous blog, I explained How to add custom metadata using Syncfusion library. But this package gives so many difficulties when adding metadata to pdf. Such problems are,    1. When once add custom meta data to a pdf, it does not able to change or remove those custom meta data from the pdf.    2. It does not compatible with meta data search engines. It does not show custom meta data properly when those are searched through the search engines. Due to these reasons, Syncfusion is not good library for custom meta data. But, iTextSharp provides flexible framework to deal with custom meta data as well as standard meta data for PDF. Below I have provided the source code to show usage of iTextSharp library. You can download iTextShrp.dll from here                              PdfReader pdf = new PdfReader(input_path); ...

How To Kill WinWOrd Process In C#

When You open MS Word Document pro-grammatically using 'Microsoft.Office.Interop.Word', you are creating 'winword' process. So after dealing with opened MS Word document  pro-grammatically though you close it using 'close' method, the 'winword' process is not terminating, it is still running on your OS. So you have to terminate it in the end of the program otherwise, it creates so many 'winword' processes for each time you open MS Word document and you may face to memory problems later.  You can use below code to kill 'Winword' process. foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName("winword"))             {                 if (!p.HasExited)                 {             ...

DSOFile.SummaryProperties.DateCreated

When we want to get the Created Date Meta Date from MS Document we can use ' DSOFile.SummaryProperties.DateCreated ' instance variable. This variable is given the date of file is originally created.                     System.IO.FileInfo file = new System.IO.FileInfo(@""+input_path);                     string creation_date = file.CreationTime.ToString(); This creation date does not mean originally created date of the document. For example, Consider I create MS Word document and save it in 'D' Storage of the memory and then I copy and paste it into MyDocument. Then the created date of copied document is considered as the copied time in above code. But, ' DSOFile.SummaryProperties.DateCreated ' is taking created date as the date of document originally created in Location 'D'

How To Add & Get Custom Meta Data To PDF or PDF/A

Here I use Syncfusion.Pdf.Base.dll to add custom meta data to PDF type documents. This DLL uses XMP based framework to define document properties for Adobe type documents. It is based on RDF which is W3C standard for XMP based Meta data. A dobe designed the st a nd a rd XMP schem a s. a mework permits the in tegr a tion of a ny schem a th a t is structured in a ccord a nce with the specific a tion. Some Examples for Adobe XMP Schemas   XMP Basic Schema   Adobe PDF Schema   Dublin Core Schema   Custom Schema      You can get more info from : http://www.pdfa.org/doku.php?id=artikel:en:pdfa_metadata          Now We Will See How To Deal with Meta Data using Syncfusion.Pdf.Base.dll First make a reference to particular DLL (Select & Right click on the project name in 'solution explorer' -> Add Reference ->  Browse -> Give the path of DLL) Then add this source code to code file ...

How to Add Metadata to MS Word Document In C#

We can use DSOFile.dll to add metadata to MS Word Document or any other type MS Documents such as MS Excel, MS Powerpoint  and Images. Not only standard meta data such as created date, author, subject, category it also supports to add custom meta data. You can download  Microsoft Developer Support OLE File Property Reader 2.1 Sample (KB 224351) and get the DSOFile.dll from here Setup DSOFile.dll Create a new project in visual studio. File -> New ->Project -> select console application in 'New Project' wizard. Then Give suitable name and browse particular location to save project. then select References from Solution Explorer and Right Click on it. Select 'Add Reference' and select COM-> DSO OLE Document Properties Reader 2.1, click 'ok' Create the source code to add meta data Select on the Project name in solution explorer and right click on it. Add -> New Item -> Code File and give suitable name. Then add this code to it...

How to create a web service in eclipse (Creating bottom up web service using tomcat apache)

Configure Tomcat Apache in Eclipse Windows -> Preferences -> Server -> Run time Environments ->Add Then you can select your Apache Tomcat server click next and provide the path of Tomcat Installation Directory click Finish Creating the bottom up web service Download the latest Axis2 binary distribution from here Now we set Axis2 run time to Eclipse Windows -> Preferences -> Web services -> Axis2 Preferences Select Axis2 Runtime tab and give the path to Axis2 Runtime Location. Then click 'OK' Now create a dynamic web page by File -> New -> Other -> Dynamic Web Project Then you come to New Dynamic Web Project Wizard and give name to web project In this example - WebServiceToPrintName Here, you have to set configuration by clicking modify button Then you come to Project facet wizard and select 'Axis2 Web Services'  as a project facet Then click 'OK' Now you get new dynamic web page called WebServiceToPrintNa...