About CADJAVA-703 converting a Specific areas to pdf ,can give an example

About CADJAVA-703 how to converting a Specific areas to pdf

@oliver225,

for now the most convenient way is to change viewport:

            com.aspose.cad.Point topLeft = new com.aspose.cad.Point(1281, 2735);
            double width = 1367;
            double height = 858;

            CadVportTableObject newView = new CadVportTableObject();

            // note: exactly such table name is required for active view
            newView.setName("*Active");
            newView.getCenterPoint().setX(topLeft.getX() + width / 2f);
            newView.getCenterPoint().setY(topLeft.getY() - height / 2f);
            newView.setViewHeight(height);
            newView.setViewAspectRatio(width / height);
            newView.setUseAspectRatio(true);


            // search for active viewport and replace it
            for (int i = 0; i < cadImage.getViewPorts().size(); i++) {
                CadVportTableObject currentView = (CadVportTableObject) (cadImage.getViewPorts().get_Item(i));
                if ((currentView.getName() == null && cadImage.getViewPorts().size() == 1) ||
                        StringExtensions.equals(StringExtensions.toLowerInvariant(currentView.getName()), "*active")) {
                    cadImage.getViewPorts().set_Item(i, newView);
                    break;
                }
            } 

We have also planned to improve the usability using separate API methods to export part of the image in future.