Jump to content

print to pdf inconsistency


aggie_moose

Recommended Posts

Hello all,

 

I have been working on printing to text-searchable PDFs, and ran into a little problem. When I regen a drawing and print to PDF, the output is not consistent - it changes just a little bit from plot to plot. This is unacceptable to the client, who is very picky about their drawing packages.

 

Can anyone reproduce this problem? I attached a script and a drawing that shows what I mean. I put both in C:\test\, then opened the drawing and loaded the script.

 

The result is 10 pdfs saved in that folder, each one a little bit different. The right most line is sometimes outside the print area, sometimes inside. It seems completely random. The only code that runs between plots is

 

(command "undo" "mark" "-purge" "all" "*" "no" "-overkill" "all" "" "done" "-purge" "all" "*" "no" "regen" "undo" "back")

 

 

 

But how on earth could that change the drawing?! Furthermore, why does it change the drawing in a way that's inconsistent? If it was shifting things around, that's one thing, but to sometimes change things and sometimes leave them alone? I feel like my computer is non-deterministic :(

example.dwg

print.lsp

Link to comment
Share on other sites

As I can see in your code you were using Extents to indicate the area to plot and Fit as scale. Please pay attention that this will be influenced by anything you may have located outside drawing's frame!

(command "-plot" "y" "model" "DWG To PDF.pc3" "ANSI expand B (11.00 x 17.00 Inches)" "i" "l" "n" "[b][color=magenta]e[/color][/b]" "[b][color=magenta]f[/color][/b]" "1.1,0" "y" "monochrome.ctb" "n" "w" "C:\\test\\test0.pdf" "n" "y")

I suggest you to look using instead Window (since you were printing from Model Space), respectively a ratio (i.e. 1:1); this will produce consistent results. For sure it requires also consistent designed drawings - drawing frame always in the same spot.

Link to comment
Share on other sites

I did try setting limits and printing to limits instead, using this code before each print

 

(mapcar 'setvar '(LIMMIN LIMMAX)
   (mapcar '(lambda ( x ) (reverse (cdr (reverse x))))
     (mapcar 'getvar '(EXTMIN EXTMAX))
   )
 )

 

But the print output still varied from plot to plot.

 

MSasu, unfortunately when this drawing package was made, the border block was not dropped in the same place. Sometimes it was exploded, sometimes it was scaled differently, sometimes it's the A3 ratio and sometimes it's the 11x17 ratio. On some drawings, all the font was set to a huge font using mtext tags and the view was scaled to 1/8 size so that it looked right. (Some of the drawings were done entirely in comic sans, but that's another issue). I could not imagine how a drawing package could be LESS consistent. So using the window is not really an option, unless you know of a way to set it reliably.

Link to comment
Share on other sites

Setting the limits to EXTMIN / EXTMAX system variables then using Limits as print area is just equivalent with using Extents. I think that Eldon was considering setting the limits manually in each drawing, thus evaluating their content.

 

But, to stop us guessing, it would be very useful to actually post an example on what you mean by aforementioned variations. Since you were printing to PDF make screen-shots of two outputs and mark the trouble-maker differences.

Link to comment
Share on other sites

Ah ok, yes I believe that would work. There's around 7000 drawings in the project, though, and setting the limits for each manually would be very time-consuming. Additionally, though it pains me to say this, setting the limits is a bit too advanced for some of our CAD users. I've even gotten complaints that typing a single command to run a script was too confusing (they wanted a button on the ribbon).

 

Here's a gif showing the 10 pdfs that were made with the lisp I provided. each one was plotted using exactly the same settings. The problem is when it wanders too far to the right and part of the border is outside the print area.

 

http://i.imgur.com/b4Tax0Y.gif

Link to comment
Share on other sites

Here's another example. It's not just the border that moves around, it's everything in the drawing. It's as if the print coordinates change a bit whenever you undo a purge and a regen. It's not the regen command that makes it change, it's the purge, regen, undo. This leads me to believe that somehow "undo" isn't actually undoing everything... something is different from plot to plot.

 

http://i.imgur.com/ztf1ZOx.gif

 

Of course, this is only speculation. I have no clue what's going on :huh:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...