Click here to Skip to main content
15,886,088 members
Articles / Desktop Programming / Windows Forms

View PDF files in C# using the Xpdf and muPDF library, Print PostScript.

Rate me:
Please Sign up or sign in to vote.
4.78/5 (39 votes)
26 Nov 2010GPL34 min read 1.6M   311   245  
Wrapper C# class written in C++\CLI and a sample implementation in C# to render PDF files.
#ifndef _HTML_LINKS
#define _HTML_LINKS

#include "GVector.h"
#include "GString.h"

class HtmlLink{

private:  
  double Xmin;
  double Ymin;
  double Xmax;
  double Ymax;
  GString* dest;

public:
  HtmlLink(){dest=NULL;}
  HtmlLink(const HtmlLink& x);
  HtmlLink& operator=(const HtmlLink& x);
  HtmlLink(double xmin,double ymin,double xmax,double ymax,GString *_dest);
  ~HtmlLink();
  GBool HtmlLink::isEqualDest(const HtmlLink& x) const;
  GString *getDest(){return new GString(dest);}
  double getX1() const {return Xmin;}
  double getX2() const {return Xmax;}
  double getY1() const {return Ymin;}
  double getY2() const {return Ymax;}
  GBool inLink(double xmin,double ymin,double xmax,double ymax) const ;
  //GString *Link(GString *content);
  GString* getLinkStart();
  
};

class HtmlLinks{
private:
 GVector<HtmlLink> *accu;
public:
 HtmlLinks();
 ~HtmlLinks();
 void AddLink(const HtmlLink& x) {accu->push_back(x);}
 GBool inLink(double xmin,double ymin,double xmax,double ymax,int& p) const;
 HtmlLink* getLink(int i) const;

};

#endif
   

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Engineer HidraQuim SA de CV
Mexico Mexico
I'm a Chemical Engineering that loves the programming.
2003 - Graduated from Technical Programmer UNIVA México.
2009 - Graduated from Chemical Engineering Universidad de Guadalajara, Mexico.
Programmer by Hobby since 6 years ago.

Comments and Discussions