.NET library for typesetting documents (PDF or similar)? -


edit: better explanation: before setting bounty question want state clearer need:

i need .net library generating printable documents. users should able print same document see either using application or using external tool (like adobe acrobat reader). not have library generating pdf documents, document format satisfies above condition do.

i need library support following scenarios:

scenario 1:

  1. i create text in font , color.
  2. i ask library width if text if printed.
  3. i compute position([x,y] coordinates on page) of text based on information 2. , have library print in @ position on page.

scenario 2:

  1. i create text parts of in superscript. parts of text (normal , superscript) in same (but variable) font.
  2. i ask library width if text when printed. correct answer takes kerning between normal text , superscript account.
  3. i compute position([x,y] coordinates) on page text should printed (using width step 2.). let library print @ position. printed on page has width returned library in previous step.

note second scenario: have text parts in superscript - example aaa{v-superscript text}bbb (where text in {} braces superscript). library needs able print text using correct kerning. without right kerning there same gap between last a , first superscript v between last superscript t , first b. user there space between a , superscript v no space after last superscript letter. text ugly. if library handle correctly have method print whole text aaa{v-superscript text}bbb @ once specification part of in superscript. use correct kerning between normal text , superscript.

scenario 3:

  1. i want print picture consists of lines, circles, filled circles, letters , bezier curves on exact point in page. need specify width of lines , circles. shapes needs printed in pixel precision.

the library should free of charge , not gpl (lgpl ok). there allows me need ? can done itextsharp (version 4.1.6 lgpl not agpl)? or perhaps fixed document ? thank suggestions.


original question:

i need typeset complex documents in .net (c#) application user. primary use of documents printing.

documents contain text , simple generated graphics. layout of text , graphic complex , needs computed (in words text position in document needs controlled code, not done automatically chosen library).

here api requirements:

  1. function returns exact width given string , given font in text should appear
  2. ability position text exact position on page
  3. have text part of in super script
  4. function exact width of text has part of in superscript
  5. ability add pictures or better option draw simple graphics (line of given thickness, filled circle of given radius/diameter)

it not have library creating pdf documents - other "what see printed" document format do. if there wpf component can displays such documents advantage. i know there itextsharp not easy achieve 4. requirement itextsharp. of course pdf generation library satisfies requirements above great solution too.

thank suggestions, i'm happy provide details or clearer explanation.

you can docotic.pdf library (disclaimer: work bit miracle). has user-friendly api , set of samples can view online or run in sample viewer application.

also satisfies requirements:

  • function returns exact width given string , given font in text should appear

you can use pdfcanvas.measuretext() method this.

  • ability position text exact position on page

there many overloads allows show text in arbitrary position or area.

http://bitmiracle.com/pdf-library/help/pdfcanvas.drawstring.aspx

http://bitmiracle.com/pdf-library/help/pdfcanvas.drawtext.aspx

  • have text part of in super script

the pdfcanvas.textrise property allows show superscript text. can use in combination pdfcanvas.fontsize property control size of superscript text. sample: http://bitmiracle.com/pdf-library/help/text-rise.aspx

  • function exact width of text has part of in superscript

if use different font or font size superscript text direct call of pdfcanvas.measuretext() method produce incorrect results.

there workarounds:

-measure each part of string drawn different fonts separately , sum widths.

-if want width of drawn text can subtract initial text position final text position after drawing.

  • ability add pictures or better option draw simple graphics (line of given thickness, filled circle of given radius/diameter)

supported. @ samples:

http://bitmiracle.com/pdf-library/help/graphics.aspx

http://bitmiracle.com/pdf-library/help/images.aspx


pdf viewer component in our plans, docotic.pdf doesn't offer such functionality.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -