Friday, August 26, 2005

Software Development

This one's partially for Earl. At the very least, he pretended to want to know what it is that I'm working on. Well, to appease him and the inborn desire to be understood, I will explain.

The problem is this: Pro/Engineer is the CAD software that my Engineering firm uses. It has a lot of automated things, like the creation of a PDF representation of the drawings the engineers and designers create.

There is a problem with the way that Pro/E creates the file, though. The size for the first page is automatically given to all ensuing pages. This is not a problem as long as all of the pages are the same size. We at Sperry Drilling Services use a standard letter-sized page for Bills of Material, which are generally page 2 and beyond.

So, the PDF that is generated looks like this:




What I have been doing is going through the file and finding the topmost mark and the rightmost mark made in the postscript file (which is the transitional file that Adobe takes and turns into a PDF.
I make the pagesize as large as the furthest distance right and up, and that crops the pages so that they are correct.
The next challenge is dealing with the bottom margin. I'm still working on it but it looks like I'm going to be shifting everything down as far as the distance from the bottom-most mark to the bottom of the page.
Given that the test postscript file I have is 589,000 lines long, I'm also learning a lot about the efficiency of certain algorithms.

Fun, huh?

15 comments:

KimLiving said...

All I got from that was "Blah blah blah. Fun hey?". And I worried that MY life was boring.

Anonymous said...

I feel so much better about my job now.

Liam J. said...

I like to spread hope wherever I can.

Anonymous said...

I recommend the following: cut it all into 256K chunks. Bubble sort them. Replace every 10th character with one of the following "(;,%". Randomly swap segments (but only up to the half - not to cause overlap). Re-assemble. Run through the PDF converter. Blame it all on the previous programmer.

Liam J. said...

There is no previous programmer. It's all on me.

Anonymous said...

doh! Umm... hire a summer student from high school? :)

Sean Woods said...

Ken, there is no god.

Only spam.

KimLiving said...

Wow. There's spam and there's SPAM. This has definitely evolved into SPAM!

Anonymous said...

I don't know what's worse: the weird spam coming into your blog or the fact that someone out there has a helpful hint for you.

Liam J. said...

Ahh, the soothing sounds of radio rodney...

Krista Leddy said...

Liam, I love your spam. So jealous of your spam. My, what hot spam you have! I wish my husband had the spam you do!

Liam J. said...

What can I say? Some people are just more attractive to spam than others. I guess I just have one of those faces.

Liam J. said...

So now it turns out that my program has a vector-out-of-range error. I commented out the changes that I made and the error still comes up.

If I were a better programmer, maybe I would understand this but I'm not and I don't.

Ah well, back to the ol' Visual Studio.

Earl J. Woods said...

I'd say "I'm sorry I asked," but that would seem ungrateful. So, er, fascinating, Liam! Sorry about the vector out-of-range error. I recommend that you switch to C++ and restack your bdoserror file. That should solve the problem.

Liam J. said...

Erm... yeah. I'm using C++, Earl.

And I'm much too busy to get back to this just yet.

ctqcqts: This CAN'T be random.