protected override NWidget CreateContent() { // Create a label NLabel label = new NLabel(); label.TextWrapMode = ENTextWrapMode.WordWrap; label.TextAlignment = ENContentAlignment.MiddleCenter; label.Font = new NFont(NFontDescriptor.DefaultSansFamilyName, 12, ENFontStyle.Underline); // Create a barcode NMatrixBarcode barcode = new NMatrixBarcode(); barcode.Scale = 2; barcode.HorizontalPlacement = ENHorizontalPlacement.Center; barcode.VerticalPlacement = ENVerticalPlacement.Center; // Place the label and the barcode in a pair box NPairBox pairBox = new NPairBox(label, barcode, ENPairBoxRelation.Box1BeforeBox2); pairBox.Spacing = NDesign.HorizontalSpacing; pairBox.FillMode = ENStackFillMode.First; pairBox.FitMode = ENStackFitMode.Last; pairBox.Padding = new NMargins(NDesign.HorizontalSpacing); return(pairBox); }
protected override NWidget CreateExampleContent() { m_Barcode = new NMatrixBarcode(ENMatrixBarcodeSymbology.QrCode, "Nevron Software" + Environment.NewLine + Environment.NewLine + "https://www.nevron.com"); m_Barcode.HorizontalPlacement = ENHorizontalPlacement.Center; m_Barcode.VerticalPlacement = ENVerticalPlacement.Center; return(m_Barcode); }
protected override NWidget CreateExampleContent() { m_Barcode = new NMatrixBarcode(); m_Barcode.Symbology = ENMatrixBarcodeSymbology.QrCode; m_Barcode.Text = "Nevron Software\r\n\r\nhttps://www.nevron.com"; m_Barcode.Border = NBorder.CreateFilledBorder(NColor.Red); m_Barcode.BorderThickness = new NMargins(1); return(m_Barcode); }
protected override NWidget CreateExampleContent() { m_Barcode = new NMatrixBarcode(); m_Barcode.Symbology = ENMatrixBarcodeSymbology.Pdf417; m_Barcode.Text = "Nevron Software"; m_Barcode.Border = NBorder.CreateFilledBorder(NColor.Red); m_Barcode.BorderThickness = new NMargins(1); return(m_Barcode); }
protected override void PopulateRichText() { NDocumentBlock documentBlock = m_RichText.Content; documentBlock.Layout = ENTextLayout.Print; NSection section = new NSection(); documentBlock.Sections.Add(section); section.Blocks.Add(GetDescriptionBlock("Barcode Widget Inlines", "Nevron Open Vision lets you easily insert barcodes in text documents as widget inlines.", 1)); // Create a table NTable table = new NTable(2, 2); section.Blocks.Add(table); // Create a linear barcode NLinearBarcode linearBarcode = new NLinearBarcode(ENLinearBarcodeSymbology.EAN13, "0123456789012"); NWidgetInline widgetInline = new NWidgetInline(linearBarcode); // Create a paragraph to host the linear barcode widget inline NTableCell cell = table.Rows[0].Cells[0]; cell.HorizontalAlignment = ENAlign.Center; NParagraph paragraph = (NParagraph)cell.Blocks[0]; paragraph.Inlines.Add(widgetInline); // Create a paragraph to the right with some text cell = table.Rows[0].Cells[1]; paragraph = (NParagraph)cell.Blocks[0]; paragraph.Inlines.Add(new NTextInline("The linear barcode to the left uses the EAN13 symbology.")); // Create a QR code widget inline NMatrixBarcode qrCode = new NMatrixBarcode(ENMatrixBarcodeSymbology.QrCode, "https://www.nevron.com"); widgetInline = new NWidgetInline(qrCode); // Create a paragraph to host the QR code widget inline cell = table.Rows[1].Cells[0]; cell.HorizontalAlignment = ENAlign.Center; paragraph = (NParagraph)cell.Blocks[0]; paragraph.Inlines.Add(widgetInline); // Create a paragraph to the right with some text cell = table.Rows[1].Cells[1]; paragraph = (NParagraph)cell.Blocks[0]; paragraph.Inlines.Add(new NTextInline("The QR code to the left contains a link to ")); paragraph.Inlines.Add(new NHyperlinkInline("https://www.nevron.com", "https://www.nevron.com")); paragraph.Inlines.Add(new NTextInline(".")); }
protected override void InitDiagram() { NPage activePage = m_DrawingDocument.Content.ActivePage; // Create a barcode widget NMatrixBarcode barcode = new NMatrixBarcode(ENMatrixBarcodeSymbology.QrCode, "https://www.nevron.com"); // Create a shape and place the barcode widget in it NShape shape = new NShape(); shape.SetBounds(100, 100, 100, 100); shape.Widget = barcode; activePage.Items.Add(shape); }
private void UpdateBarcode() { NAppointmentBase appointment = this.Appointment; if (appointment == null) { return; } // Serialize the appointment to string NIcalFormat format = new NIcalFormat(); string text = format.SerializeAppointment(appointment, false); // Update the text of the matrix barcode widget NMatrixBarcode barcode = (NMatrixBarcode)GetFirstDescendant(NMatrixBarcode.NMatrixBarcodeSchema); barcode.Text = text; }