Converting raw print codes to a printer using a VB.net web page - vb.net

I've run into a situation I've never encountered before. I'm working with a shipping API for an e-commerce site and I've retrieved a shipping label. The problem is that the code used for the label is what appears to be raw print codes. They look something like this:
N
Q822,24
R40,0
S4
D15
ZB
A760,120,1,1,1,1,N,"Interlink Express"
A735,080,1,1,1,1,N,"www.interlinkexpress.com"
A706,033,1,1,1,1,N,"Sender"
.... more codes like this
LO001,330,765,10
LO001,025,765,1
LO001,192,590,1
LO001,330,765,10
.... more codes like this
P1
What I'd like to be able to do is convert it to a graphic or something else that I can print from a web page. The problem is that I can't find any ways to deal with this particular type of information, since it's not in a web-standard format (it's not HTML, XML, JSON, etc.)
How would I deal with something like this?
Thanks.

In the end, I solved this a different way. Apparently the shipping company was able to use an Accept: text/html header from my HttpWebRequest and I got an HTML-formatted printer label. So we're good. Thanks.

Related

Using datepicker in DotNetNuke-7 module

I'm a DNN beginner. I am currently building a module in which I can display statistics. My DotNetNuke Version is 7.0. The statistic is from Chartjs. For this statistic I would like to implement filters. These filters should be datepickers. As UI element I have now included a textbox with TextMode='Date'. But currently I have problems to set the default value of this field. The default value should be 01.01. of the current year.
I have already tried to set the value via C# server side. Unfortunately without success. I also tried to set the value on the client side via JavaScript. Unfortunately also without success.
These are some lines I tried in JavaScript:
document.getElementById(<%= this.DatumVon.AccessKey %>).value = "01.01.2019";
document.getElementById(<%= this.DatumVon.AccessKey %>).innerText = "01.01.2019";
document.getElementById("DatumVon").value = "01.01.2019";
These are some lines I tried in C# in the method "Page_Load" (server side):
this.DatumVon.Text = "01.01.2019";
I expected the value of the TextBox to be 01.01.2019. However, it currently only contains dd.mmm.yyyy. How can I change this?
Thank you.
There is something wrong with your localization. Please refer to the jQuery UI datepicker documentation (the "Localization" section), this should give you the answer.
wow... I solved it. I made it. Sometimes the solution is right in front of you and you don't see it. Michael Tobisch was absolutely right. When setting the value, the format is very important. I have always used the German format. A DNN TextBox with TextMode="Date" can't handle that. DNN converts this TextBox into an HTML input field. But this input field can only be clear with the format "yyyy-mm-dd". Depending on the geographical position of the client (at least that's what I think) the text displayed in the input field will be formatted. But the value of the input field always has the same format ("yyyy-mm-dd"). So very important here: the displayed text and the actual value have different formats.
Many thanks again to Michael Tobisch for the mental inspiration and the patience with me.
What is also important is that the access to the actual ID of a DNN element works as follows: this.Element.ClientID and not as I assumed before this.Element.AccessKey. This was also buggy.

Whats wrong with Neo4j 2.0 Query?

I am trying to understand why the data is not showing up in my query. I was wondering if there is any way to troubleshoot whats going on.
Here is the current issue:
I have populated some data from existing test database to check the performance with a relation like this : (e:Event)-[:FOR_USER]->(u:User) when I get all the users and look at the property, I can see the data, but when I query the users using same data it says 0 records found.
Below image shows the 2 query:
Can some one please help me understand how to debug such issue in neo4j
EDIT
Issue is that the Browser is somehow truncating the multiple spaces in the result. Like in this case "User-May<space>1 2013 1:18AM" was displayed on both webadmin and new browser, but in reality it should have been "User-May<space><space>1 2013<space><space>1:18AM"
So no matter what I do I can't query the value as looks like duplicate space is truncated somewhere.
Tabular data as Micheal suggested is as below
{"id":"75307","labels":["User"],"properties":{"Name":"User-May 1 2013 1:18AM"}}
and what we are seeing is User-May 1 2013 1:18AM
Regards
Kiran
Use the following Cypher syntax in the browser:
MATCH (user:User { Name: "User-May 1 2013 1:18AM" })
RETURN user.Name as Name
As far as the rendering of multiple spaces being trimmed, that is a browser specific functionality. See screenshot below for example:
The text itself is preserved as it is returned from the Neo4j server. As you can see when I analyze the HTML element of the browser using Firebug, the redundant spaces are indeed there.
So again, this doesn't seem to be a bug with Neo4j, it's how the browser you are using renders the text. The browser expects redundant spaces to be encoded as like so: "Testing testing" which is HTML encoded as Testing testing

PDF to .txt using iTextSharp issues

I've finally gotten a C# project loaded as a PowerShell module, and am able to convert a PDF to text, sort of.
Some of my PDFs seem to convert fine, others get cut off at the end, and some of them just simply give me output like this:
!nn!
Q9!r
!
!!
-;7!!
H*
Q0-.(;5!!n
#n%-,-Bn
!rn-;7!H+
(-;7
,-;7
,-;79
!-;7nnn;,-
n-n
n>-rn
n!!r
n+*,
,),+I-.n
#55=
!8
(
)%
rr-;7
Q!n-;7
n!Q
!!n
F3Q02
!8nH
#*825
-n-;7
-;7nrQ
&n!!-;7C4-;7
Kn>B)I!!!I
$rn==.=!
r*.//
#5>8636nKnn
I've checked the properties of the PDF files i'm testing with, and I can't find anything that sticks out as the reason a PDF outputs gibberish like above.
Can someone please give me some ideas on what else to look for and/or change?

How to find some text on webpage and show it in textbox (or just write it out) using Visual Basic?

Let's say I have a www.exmple.com website, with some text on it;
Example 1
Example 5713
Example 151
Example ...
and so on...
I would like to create a program where the user could input what is he looking for ON www.example.com... Like he is type "Example 151", it will show in a new textbox or something that can actually store text.
Is this possible?
I hope someone can help,
Thank you!
Is this possible?
Yes, certainly. You need to use an HTML parser - a library that can read the HTML and that you can then query it for.
Two popular options are the HTML Agilty Pack (uses XPath for querying) and CsQuery (uses jQuery like query syntax).

help to get rid of HTML special chars in database

I've migrated my site from interspire CMS to Joomla! CMS.
I've managed to migrate all the database of articles, but some of them have a weird issue - when I access the page from joomla, the title contains HTML entities like ’.
As you can guess from the CMS's I use, I rely on PHP as my server side, and MySql for my database.
I tried to go over the titles of the articles in the database with htmlspecialchars_decode AND html_entity_decode in order to get rid of those, but it had no effect.
if I just grab an example from the DB and echo it, it will look OK:
What’s Your Pleasure, Lasagna Or Pizza Manchester Style?
if I go to the article page in joomla it will look like this:
What’s Your Pleasure, Lasagna Or Pizza Manchester Style?
When I go to PhpMyAdmin to see directly what is in the database, this is the contents of the title:
What’s Your Pleasure, Lasagna Or Pizza Manchester Style?
I even tried to remove the symbol with:
str_replace("’","",$title);
or replace it like this
str_replace('’',"'",$title);
but nothing.
When I tried to encode it again instead of decoding it (just to see if i'm on the right DB) it worked and encoded it again...
Please, I would be glad to have any new ideas...
Thanks,
Yanipan
Try setting encoding to cp1252. This worked out for me:
$decoded = html_entity_decode($your_string, ENT_QUOTES, 'cp1252');
Probably your best bet is to do search and replace within the database itself vs trying to do it with php. Search and replace in mysql is done like this:
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);
So yours should look something like:
update ARTICLES set TITLE = replace(TITLE, '’', '\'');
Give that a shot.
Need more info
What is the character encoding on your database? That & or ;, may be something other than the typical ASCII.
It's possible that PHP/Joomla is double-encoding your string. Look at the browser's page source and find the text in the produced HTML. Instead of What’s, it might just be one of the following:
What&rsquo&59;s
What&38;rsquo&59;s
What&rsquo;s