Dwg file conversion to pdf, how to set the page full?

dwg file conversion to pdf, how to set the page full?
1715998017131.png (22.3 KB)

@dream.xg,
Hi.
Could you please attach the initial file and current export code options?

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)

@dream.xg,
it seems the attachment file is missing, could you please check?

How to upload attachments?

@dream.xg,
please put it in zip archive and attach here.

---- 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)

@dream.xg,
you can also put file to some file sharing service and attach link here to download.