dwg file conversion to pdf, how to set the page full?
1715998017131.png (22.3 KB)
try(
net.lingala.zip4j.io.inputstream.ZipInputStream zis = zipFile.getInputStream(zipFile.getFileHeader(StringUtils.format(“{}{}”,fileName,fileExtension)));
BufferedInputStream bis = new BufferedInputStream(zis);
ByteArrayOutputStream os = new ByteArrayOutputStream();
BufferedOutputStream bos = new BufferedOutputStream(os);
)
{
LoadOptions opts = new LoadOptions();
opts.setSpecifiedEncoding(CodePages.Utf8);
Image image = Image.load(bis, opts);
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
cadRasterizationOptions.setBackgroundColor(Color.getWhite());
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setVectorRasterizationOptions(cadRasterizationOptions);
image.save(bos, pdfOptions);
ZipParameters parameters = new ZipParameters();
parameters.setFileNameInZip(StringUtils.format("{}{}",fileName,".pdf"));
try(
InputStream is = new ByteArrayInputStream(os.toByteArray());
BufferedInputStream bis2 = new BufferedInputStream(is)
)
{
zipFile.addStream(bis2, parameters);
}
catch (Exception e)
{
throw e;
}
}
catch (Exception e)
{
throw e;
}
–How do I get the documents to you?
hi,Convert exception file, in the attachment
---- Replied Message ----
From | Alex Gorokhovatskyi via Free Support Forum - aspose.comforum@aspose.com |
- | - |
Date | 5/18/2024 12:53 |
To | dream.xg@qq.com |
Subject | [Free Support Forum - aspose.com] [Aspose.CAD Product Family] Dwg file conversion to pdf, how to set the page full? |
| oleksii.gorokhovatskyi
May 18 |
- | - |
@dream.xg,
Hi.
Could you please attach the initial file and current export code options?
(Attachment 20240418_NX10.0 保湿抽屉右_dwg1.dwg is missing)
How to upload attachments?
---- Replied Message ----
From | dream.xgdream.xg@qq.com |
- | - |
Date | 5/18/2024 13:37 |
To | asposeforum@aspose.com |
Subject | Re: [Free Support Forum - aspose.com] [Aspose.CAD Product Family] Dwg file conversion to pdf, how to set the page full? |
hi,Convert exception file, in the attachment
---- Replied Message ----
From | Alex Gorokhovatskyi via Free Support Forum - aspose.comforum@aspose.com |
- | - |
Date | 5/18/2024 12:53 |
To | dream.xg@qq.com |
Subject | [Free Support Forum - aspose.com] [Aspose.CAD Product Family] Dwg file conversion to pdf, how to set the page full? |
| oleksii.gorokhovatskyi
May 18 |
- | - |
@dream.xg,
Hi.
Could you please attach the initial file and current export code options?
(Attachment 20240418_NX10.0 保湿抽屉右_dwg1.dwg is missing)