How to create so much TextBoxes or labels in form (vb.net)? - vb.net

I need to display many independent chars on a form. The problem happens when there are about 1000 labels and the program crashes. Is there a light-weight container for chars?
Well, I need make a canvas like the picture. The trouble is that I also need to insert images at textbox and several lines mixed, but I just want to select some lines.

Related

Conveniently randomize image via button from folder/slide?

I often spend hours bringing pictures into PowerPoint templates one by one and trying to customize the way a presentation whose behavior is very different.
If there were a way to randomly select an image from all of the images on a different slide or excel file or folder and have them appear based on the probable weight assigned to them, it would be a huge time saver.
I've seen various methods of having a random object appear, and some of them don't even require a macro, but importing the images is always very time consuming. If anyone knows of a better/faster way to link a folder with a group of images or something along these lines to an object that is randomized, please help.
Importantly, showing a random image from a batch group without customizing the way each image is brought in is the hard part. Adding weight helps, but it could be done by duplicating important images repeatedly.

How to detect visible text in a text field in a PDF?

When using PDFBox to populate a text field in a form in a PDF, it is possible that the text overflows the text field and is not visible when opening the PDF in a viewer.
Question: Is it possible to use PDFBox to detect how much text within a text field is visible?
At the risk of falling victim to an XY problem, here is the context in which this came up.
I have a PDF which is provided by the Danish government, and the software I am creating needs to be able to fill out this form programmatically. On pages 5 and 6 of this document, there is a large blank area that needs to be filled out. The way the PDF creators designed it, they just made two text fields (named Text57 and Text58), which a person directly filling out the form would manually need to jump between.
The problem is, I need to be able to populate these fields with text, and if the text is too large to fit in the first text field, then it needs to overflow into the second text field. However, I do not seem to have any way of actually detecting when the text overflows in the first text field.
One workaround which could be acceptable, would be if I could modify the document to remove the second text field, and just have the first text field span multiple pages, but while playing around in Acrobat, this does not seem to be possible.
The PDF in question can be found here: https://www.trafikstyrelsen.dk/~/media/Dokumenter/10%20Bolig/Bolig/Private%20lejeboliger/Lejekontrakt/typeformular-a.pdf
Here is a code snippet which populates the problematic field with 100 lines numbered from 1 to 100.
PDDocument document = PDDocument.load(new File("typeformular-a.pdf"));
PDField text57 = document.getDocumentCatalog().getAcroForm().getField("Text57");
text57.setValue(IntStream.range(1, 101).mapToObj(Integer::toString)
.collect(Collectors.joining(System.lineSeparator())));
document.save("typeformular-a.out.pdf");
After the code is run, we can see that the text gets cut off after line 44. Of course I cannot simply count lines in my text, because under normal circumstances the lines in the text will wrap, which would invalidate that approach.
Auxiliary question: Is there any other approach that could solve this original problem of splitting text across multiple pages?

Windows Form, image gridlines

Currently I want to create an application.multiscreen transitionstrong text
But I have a problem I do not know how to do these lines that divide the image into several parts. I want to cut the image into several parts and these parts you can handle, please at least some ideas.
If you want to split images up programmatically you are first going to have to choose a file format to support. I suggest PNG to begin with because their encoding is fairly simple to understand (see HERE) and c# has a class to decode it (see HERE.)
You'll want to think of the PNG file as a matrix of RGB values that you can split up and store into separate new smaller PNG files.
If you want to support other image file types you will have to do some research into their encoding formats and handle them differently.
Well I did. Of course other method as I create a WPF application. show image
This program is intended to control 3, 6 and 9 monitors connected by Raspberry Pi. As you can see in the image I want to first grid to have 2 buttons. The first button to set the image resolution of first grid. The second button can send images from the first grid to the first monitor and so on all grids.
Thank you very much for your help. Wait a few suggestions.

SSRS textbox clipping when exporting to PDF

I was working with an SSRS report that uses multiple textboxes in a list control. I found that when I ran and exported my report to PDF (and printed/exported to .XPS), certain textboxes would just ever so slightly get clipped.
Note: when the report rendered in SSRS development env., every textbox looked fine and the text never got clipped. The issue just occurs when exporting, and on seemingly random textboxes (random to me).
I've tried adjusting the height and width properties of the textboxes, and the CanGrow property to true/false. Even making the text a different size (like 5 point) or even a different font made no difference. The amount of text that filled the field didn't matter. I made sure the margins on the page were sufficient. I also made sure there were no other report objects that were overlapping the offending textboxes. Neighboring textboxes that displayed fine were set to be perfectly aligned vertically with ones that had the text problems, and still no luck.
None of these options above worked. I have also seen a few questions on stackoverflow that are similar, but not exact.
How do I keep these textboxes from clipping the text when exporting to PDF?
Thank you.
Sample: textbox text is cut off very slightly on SSRS report exported to PDF for certain textboxes
I have solved my own issue after some tinkering, though perhaps its not the best solution out there but it works.
I hard coded a space character at the end of each textbox field's expression that had the clipping issue,
For example:
=First(Fields!zipCode.Value) + " "
The only minor draw back is that it shifts the alignment of the text left by one space. Hope this helps.
I played around with all sorts of options with indent, padding and even added a gutter column. This seemed to work for a while but when the problem raised its head again, I just changed my font.
I think there might be something up with "Calibri" and "Calibri Light" but "Candara" seems fine.
Bit frustrating this only shows up on server generated pdfs as it makes the feedback loop so much longer.

line spacing in label + vb.net

I have a .NET 2.0 standard Label on my form, well I put some text in it with several lines. But the spacing between the lines are too small. Just want to know if there's a way to fix this.
Thanks...
The only solution I can see would be to make multiple labels and space the labels appropriately.
You may need to create the labels dynamically, one per line.
Of course, you could do a .Split(vbNewLine) on the text you want to display and then for each string in the list, create a new label control, adding it to the form, and spacing it out appropriately from the previous label.
Not ideal, but about the only way to accomplish it.
There is another alternative way to work out that you use the WinformHTMLTextBox then embed the content by using html code which you can employ the advantage of CSS.