Good afternoon,
Please find attached the resulting DXF file exported at the end of the process and the looks of the resulting PDF. Note that the PDF export is done just above.
What we are using on the process is a template with title/subtitle to directly frame what we want to print in the DXF. As the frame (layers: Marc_pdf_1 and Marc_pdf_2) is black and white, we disabled the option that alterates both colors when printing, so that we can actually get both of the actual colors as intended.
That is why during the process we also attack layers like EXTERNAL_DIM and NEIGHBOR_DIM to explicitly set its objects to black. Disabling the "Prevent white on white /black on black display" option, exporting to PDF directly from QCAD gets us the desired result, so I do not think it has anything to do with thin lines.
To further extend the code provided, we are following this schema:
Code: Select all
//! [document]
var storage = new RMemoryStorage();
var spatialIndex = new RSpatialIndexNavel();
var document = new RDocument(storage, spatialIndex);
var di = new RDocumentInterface(document);
//! [view]
var scene = new RGraphicsSceneQt(di);
var view = new RGraphicsViewImage();
view.setScene(scene);
//! [view]
// Import various input DXF files
for (...){
var doc_insert = new RDocument(new RMemoryStorage(), new RSpatialIndexNavel());
var di_insert = new RDocumentInterface(doc_insert);
if (di_insert.importFile(insert) !== RDocumentInterface.IoErrorNoError) {
qWarning("cannot import file: ", insert);
}
var op = new RPasteOperation(doc_insert);
op.setOffset(new RVector(0, 0));
di.applyOperation(op);
di_insert.destroy();
}
// Modify operationg on both layers and entities, for example
var op = new RModifyObjectsOperation();
var layer = document.queryLayer("0");
layer.setLineweight(18);
layer.setColor(black);
op.addObject(layer);
di.applyOperation(op);
// set Document variables and export
[...]
document.setVariable("PageSettings/OffsetX", OffsetX);
document.setVariable("PageSettings/OffsetY", OffsetY);
[...]
//! [export]
var print = new Print(undefined, document, view);
print.print(outputFile + "_" + String(i) + ".pdf");
//! [export]
// Export for checking result in DXF
di.exportFile("path/to/final.dxf");
Thank you for your time. We are really welcome for your comments and hope for your further advice.
EDIT: I also attached what we see when opening the generated "final.dxf" in QCAD with the specified application options.
Pere