PDF to SketchUp

In a typical workflow I’d advise against trying to import PDFs as most PDF writers appear to round coordinates into what is a reasonable precision on paper (maybe it’s even specified in the format). A PDF can look great in print but when zoomed in, tiny details are often jagged, and when imported to SketchUp (through converting to DWG or DXF in an image editor) you end up with parallel edges not being perfectly parallel and pushpull and other tools don’t work properly.

That said I still think a PDF import would be very useful in a lot of scenarios anyway. This is one of those “small” things that would just make the program a lot more practical and friendly to use, which is all what SketchUp is about.

And then there are so many other things that could be done by including a PDF parser library. reference PDFs as images in LayOut would actually make the program usable to assemble presentations not entirely made in SketchUp. Being able to use the same icon both on Mac and Windows would also fix one of the more random annoyances we extension developers face.

3 Likes

I haven’t looked in Layout 2020 yet but I know that in 2019 I could not insert a vector file (wmf, ai, pdf, svg etc) into Layout as a logo for title blocks (for example). Has this changed? If not that also needs to be looked into.

No. Mac users can import PDF files but they get converted into raster images in the process. DWG/DXF is still the only way to get 2D linework in as geometry.

4 Likes

Thanks, I haven’t looked in LO2020 yet. That’s too bad that it is STILL missing this feature.

As John wrote in this thread and what has been written elsewhere, the reason PDF files can be imported on Macs but tot on PCs is because Apple’s OS supports that and Windows doesn’t.

You could easily include a library for parsing PDFs. Windows doesn’t have built in DWG, DXF or COLLADA support, yet SketchUp has.

2 Likes

I wasn’t indicating it shouldn’t be an option. Only that the reason it is an option on Mac right now and not on the PC is because of the offerings of the operating systems.

1 Like

There are lots of issues importing 2D PDFs as linework, not images, even if the file is pure vector. Lines in PDF are actually finite-width strokes, with fill, end shapes, etc. not just the basic stroke path. Unless the creator was quite careful, there is no assurance that the endpoints of segments actually meet, they just look like it. And they are put onto the canvas using the painter’s algorithm, that is, things drawn later overlay things drawn earlier. They don’t intersect the way SketchUp geometry does. So you need a new group for every stroke path. There’s more, but that’s enough for now to illustrate that it is not a simple import unless you render the pdf as an image the way that a pdf processing engine does when it displays or prints.

3 Likes

even on a mac using a postscript conversion to dxf polylines is the best…

pstoedit  -f dxf:-polyaslines /tmp/vector.pdf  /tmp/pdf.dxf 

I import into SU using cm and scale afterwards…

I’m sure there is a converter for windows…

john

4 Likes

Hi Everyone, Thank you for all of the input. I see that file inclusion no mater the starting point is still a tough hurdle to jump. I know that PDF’s are used often by architects as a way to accommodate sharing if you don’t have any other means. I just had to import a svg file which I didn’t know people still used it. I feel it would make work less anxious if we could have the accuracy and ease to send to anyone without a specific program.
Thank you everyone, I appreciate the discussion.

I don’t see why they don’t send you .dxf or .dwg both of which are work on both ends of the pipeline.

3 Likes

Hi Box, I don’t ask sometimes because maybe a PDF is all that they have. Sure I agree the dwg & dxf 's are my preference. but maybe it’s an old archive that they want to use again, or the client as is the case with the fires lost it all and a PDF is all that’s left. I’m not saying I don’t get the dwgs and dxf’s, but for the times I want to help when they don’t it’s very difficult. Here in Sonoma after 2 years of cinder there were some architects who lost drawings and everything. I’m trying to do what I can with what they have.

If you Ihave Adobe llustrator you can open a vector based PDF, isolate the art that you want, and export it as a DWG, which works on both a Mac and a PC and is quite simple.

3 Likes

Fair enough.
There are quite a few converters these days.
I’ve just found this on the net as a pdf, converted it and imported it as a .dxf without any issues.
I’m not saying native pdf import wouldn’t be useful but it’s not crippling without it.

2 Likes

Hi Box, I agree. Thank you.

I’m not fully up-to-date on John’s code, but presumably, he has licensed a third-party PDF import library that allows him to offer this feature.

2 Likes

Been there, easy said than done.

Your mileage may vary, doesn’t mean it doesn’t work.

Every architect that can produce a PDF should just as easily be able to produce a DXF or DWG. Unless they draw by hand and then scan the drawings.

6 Likes

Inkscape, too, can open a PDF and save as DXF. It’s free.

I think quite many applications with this feature use the free, open-source Ghostscript and Pstoedit.

3 Likes