Question

I would need to programmatically (i.e. no human interaction) load HPGL files (coming from third party software) in Java and create a new HPGL file with different proportions (X ratio and Y ratio, passed as parameters to the program)

Let's say that I have the file "One.hpgl" which is a Square (X=1mt Y=1mt). From outside I receive xratio = 90% yratio=110%. I would need to write Java code to produce an output "ModifiedOne.hpgl" which is a Rectangle (X=90cm Y=1.10mt).

Is it feasible in Java? If so, which is a suggested HPGL library for this kind of work? I am new to HPGL, so if this is possible, the "shrink/enlargement" should be done once per file or "segment by segment"? I ask because the HPGL files which I should shrink are not simple squares but are more complex drawings and so "shrinking" line by line would be quite difficult.

Thanks for any help you can give me

Était-ce utile?

La solution

There seems not to be a ready-made HPGL parser in Java.

Take a look here: https://github.com/sigram/pcl-parser (limited HPGL, but in Java already)

Also here: http://hpgs.berlios.de/ (more complete HPGL support, but in C)

HPGL references are also available, so you can create a parser from scratch.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top