The Ashes

Technology, Science and other news
August 9, 2009

WPS: PostScript and PDF interpreter for HTML 5 canvas

Posted by : admin
Filed under : General

It would be a pretty cool hack to implement a PostScript/PDF interpreter in JavaScript wouldn’t it? That is exactly what has been done with WPS.

The code takes PS and really groks it so:

PLAIN TEXT
JAVASCRIPT:

  1.  
  2. /n 10 def
  3. /w 25 def
  4.  
  5. 0 0 n w mul dup .gbox
  6.  
  7. 4 dict begin
  8.   0 1 n 1 sub {
  9.     /i exch def
  10.     /ii 1 1 n div i mul sub def
  11.     0 1 n 1 sub {
  12.       /j exch def
  13.       /jj 1 1 n div j mul sub def
  14.       ii jj 0 setrgbcolor
  15.       w j mul w i mul w w rectfill
  16.     } for
  17.   } for
  18. end
  19.  

becomes:

And all in ~400 lines of code! Check out the examples….. just awesome!

Tags :

No Comments

(required)
(will not be published) (required)
(opitional)

cciash.com EN ES IT DE PT CZ FR RU
June 2018
M T W T F S S
« Sep    
 123
45678910
11121314151617
18192021222324
252627282930  

Pages

Categories

Resources

There are many online poker site where you can play but at poker.hk you can play the poker games with all the knowledge you need related to the game with the poker school available in both the English and Chinese language.

Super Casino

Now you can bet on any sports and any sporting events from all the comfort from your home. Bet770 allows you to bet on any events and match with in just 3 clicks. They also offers great odds on football betting for every premier and champions league match. Get £50 free in bets when you register.

Bingo770, offering best online bingo games with £7.70 free no deposit Bonus!