Can I insert exponents in a textbox (VB 2008-10)? - vb.net

I have been Googling out for many days on how to solve a linear equation programatically. I have in my calculator app, a form frmLEquation and a textbox txtEquation where the user enters the equations like 2x^2 = 32. I searched many webpages but I could not find the exact answer. Here, how do I add an exponent, which is of smaller font size than the others to a variable for example 2x? I found this webpage here, but I don't know how to interpret the code.
Please help me with the above situation. In case you have doubts/clarifications etc, please respond back.
Thanks.

You will need to use a Rich Textbox instead of a regular textbox control.

Related

Create variants of a document with corresponding labels for AI training

I am looking for an easy solution for the following problem:
I have to create variants of a document and export them as an image. This could be easily done with the MS Word Mail Merge, but I need the pixel positions of every text block in that document. The image as well as the pixel positions are input for an AI training.
At the moment I can think of several approaches:
Throw the MS Word Mail Merge output into an OCR and try to identify the positions of the text blocks by comparing them with the original text source.
Create the document with something like JS, Python or Visual Basic and save the exact positions of each inserted text block at the time of inserting.
Maybe use Visual Basic for Word to extract the text positions from the MS Word XML file that was created with the Mail Merge function.
Variant 1 seems to be overly complicated because it uses some kind of reverse engineering. Additionally, using an OCR even on a perfectly readible document can always be a source of error.
So variants 2 or 3 seem fine, but I don't know any libraries that fit the requirements and Visual Basic for Word is absolutely new territory for me.
I hope I described the problem well enough. If you want me to clarify something, please let me know.
I appreciate every idea and help! :)
Best Regards
Henrik
Seems like someone already dislikes my post. Please let me know how I can improve before voting me down..
Anyway, I may have found a way to realize variant 2. This stackoverflow post references a Github Gist that extends the Python Image Library. It offers a function to write text on an image and also set a maximum width for the text box. The function also returns the final width and height of the drawn text box. Using this I will try to implement an algorithm that creates the document images as well as the label files.
Maybe this will also help someone else looking for the same thing.

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.

Finding specific letters in a text file and returning that as a string with my name to be placed in label control VB2010

I have a project where I have to find the letters of my name in a given text file in VB2010 and return those letters using string manipulation techniques as my name into a label control.
I have looked at several youtube videos and looked around the web. Some recommend putting the text file into an array. Some others are just for one specific word (Which my name isn't in the text file as a word). So I really haven't found anything to suit my needs.
I know the code needs to placed in the event load form.
I've only been at VB for 7 weeks, so I am novice.
Any tips or hints are appreciated. If further explanation needed please let me know.
Thanks,
Well, we won't do your homework for you, but here's a HOWTO on reading a text file in VB.NET. It's a good starting point.
How to: Read Text from a File
Look up regular expressions. This should help you with the parsing of the text file.

Photoshop jsx image grid

What I am ultimately trying to do is to create a grid of images for print that are minor variations of the same thing (different text is all). Looking through online resources I was able to create a script that changes the text and exports all of the images necessary (several hundred). What I am trying to do now is to import all of these images into a new photoshop document and lay them all out in a grid and I can't seem to find any examples of this.
Can anyone point me in the right direction to place a file at a specific coordinate (I'm using CS5 and have the design suite so if there is a way in illustrator to do this quickly...)?
Also, I'm open to other ideas on how to do this (even other programs) easily. It's for labels so the positioning on the sheet has to be pretty precise...
The art layer object has a translate() method that takes delta x and y params. You'll need to open each image, copy it to the target document, get its current location (using artLayer.bounds) and do the math to find the deltas to position it where you want it. Your deltas can be in pixels so you'll get plenty of precision.
Check out your 'JavaScript Scripting Reference' pdf in your Adobe install directory for more details.
Ok I'm marking Anna's response as the answer because though I didn't fully test it, it seems like it should work and answers the original question with jsx. However I'm also leaving my final solution in case anyone else runs across this with the same issue and may prefer this method as well.
What I ended up doing instead is using InDesign. I figured out that it has a grid option that lets you import a number of files and place them all in an equal grid in a single command. This is almost exactly what I was looking for, except that it leaves a small border/margin in between the columns and grids and mine were designed to meet exactly.
I couldn't figure out how to make it not have the border (I have very little experience with InDesign, it may be possible). However I was able to select all my images and scale them uniformly to be the correct size, then I just selected each column and dragged it over to snap to the adjacent column and the same with rows...

Acrobat displays double value in fillable field

Whilst using Acrobat Pro 9, I've created a fillable form and used the "simplified code" to calculate some values. Then I applied some font formatting and set the field to display in the number format and display the currency marker.
Now my form displays the value twice and in both fonts! It does it on every form field, no matter if I've added code or not.
It also doesn't matter whether "Highlight Fields" is enabled.
I tried using different fonts: Courier Bold, Trebuchets and others and still get the same problem. You can see in my picture that there the value is repeated "behind the scenes" in a smaller, grayer font.
How can I fix this?
Well, after long last and trying to reproduce the error, I think it must have been a rendering issue in Adobe Acrobat. I can't seem to reproduce it again (it figures), not even in Adobe Reader.
Thanks to whoever took an interest! I leave this "solution" here in case anyone runs into the same issue.