API reference
This page lists application-facing APIs. Follow the linked guides for operation details and setup.
Facade operations
Dwg::thumbnail(UploadedFile|string|DwgBinary $source): ThumbnailExtraction
Dwg::toDxf(UploadedFile|string|DwgBinary $source): DxfConversion
Dwg::toJson(UploadedFile|string|DwgBinary $source): JsonConversion
Dwg::toImage(UploadedFile|string|DwgBinary $source): ImageConversionEach method binds a source without I/O and returns a new operation. See Inputs and outputs.
ThumbnailExtraction
extract(): DwgOutputExtracts an embedded BMP, PNG, or WMF preview. See Extracting thumbnails.
DxfConversion
toVersion(DxfVersion $version): self
convert(): DwgOutputtoVersion() returns a new operation with the selected target. convert() creates ASCII DXF. See Converting to DXF.
DxfVersion cases: R12, R14, R2000, R2004, R2007, R2010, R2013, R2018.
JsonConversion
convert(): DwgOutputCreates LibreDWG structural JSON. It has no target-version or format option. See Exporting structural JSON.
ImageConversion
format(ImageFormat $format): self
usingDxfVersion(DxfVersion $version): self
atResolution(ImageResolution $resolution): self
convert(): DwgOutputEvery option returns a new operation and preserves the other selections. See Creating image previews.
ImageFormat:PNG,JPEG,WEBP.ImageResolution:HIGH,MEDIUM,LOW.
DwgBinary
DwgBinary::from(string $contents): DwgBinary
$binary->contents(): stringWraps raw bytes so a string is not mistaken for a local path.
DwgOutput
extension(): string
mimeType(): string
output(): string
storeAs(string $path, string $name, ?string $disk = null): stringextension() and mimeType() do not consume the result. Call exactly one of output() or storeAs().
Exceptions
LibreDwgUnavailable, InvalidDwg, and DwgOperationFailed all provide:
reason(): string
context(): array