Grab content from QuarkXPress file - asp.net

Hi
I’m trying to develop an E-Paper website using .Net. But At first the content of the website need to grab from the Quark file. What is the procedure to get the content from the Quark file according to the Layout?
So it would be highly appreciated to provide some information regarding this subject.
Thanks…

This is going to be a tough project since the QuarkXpress files are 1) proprietary and therefore are not well documented, and 2) binary so the data is harder to get at. This will require a lot more work than a post on StackOverflow.com can help with.
First, ASP.NET really isn't the right framework for it. At least, you should develop this as a C# or VB code library project which is then consumed by a ASP.NET web application.
In order to parse the file, you might want to start off by reading Reverse engineering the Quark Xpress file format. This forum, Code for QuarkXPress file format support, also seems to have some good information. You will want to use what you learn from those articles to parse the binary and convert it to the proper types or structures. Here on some links on how to parse binary files in C#:
http://www.dotnetperls.com/binaryreader
Read binary file into a struct
http://www.yoda.arachsys.com/csharp/readbinary.html
You may also want to check out this forum posting on How to create dynamic QuarkXPress files in .Net FrameWork C#. It seems that Quark has a C# API for dealing with Quark files if you have QuarkXpress Server.

Related

Is there any .NET standard for dealing with localization yet allowing the users to customize the texts?

We're building an ASP.NET MVC application that is yet not localizable with a lot of Data Annotations DisplayAttribute with hard-coded strings and hard-coded message strings all over the code.
Now we have a requirement that the application must be localizable, but still, we need to allow the users to customize the field displays and the texts.
So far, I'm considering using RESX files with a custom IResourceProvider. Rick Strahl has written a good article about that. In this approach, the application is developed with standard RESX files, but in runtime, when the application need the strings, the custom provider will query the DB looking for customizations and will use them when found.
Even though it seems a good solution, it doesn't seem natural. I wonder if there's some better alternative.
Is there any standard for this?
What's not natural with using static values as defaults and checking database for localized ones? For me it's nice approach, because if someone will mess recources in db and, for example, remove one of them somehow, you'll always have a default text to display.
You can always do it in different way, by using only the db-based texts to not bother about changing defaults in your code and translations in database because it's easy to miss something when resources are in few places. When I was checking code of nopCommerce maybe 2 years ago, I've seen that when they do localization with resources from database only. I'm not sure how it's done now, but you can download source code and check it.
In WinForms app I developed a year ago I was using XML files for different languages because our customer wanted to be able to allow non-technical natives to create new language files. And I created localization tool built-in into app, but for websites it's best to use database, as you already have access to this and can easily manipulate data.
You can read more about this topic in this blog post.

Converting m4a -> mp3 on ASP.NET

I currently post mp3s to a site and stream it to users. However, I record in m4a and that doesn't stream unless you use flash or some special html5 implementations.
I'd like to be able to upload m4as to the site and have it converted to mp3.
There are a few implementations that wrap ffmpeg for .net, but few have any documentation (FFLIB.NET, FFmpeg.NET, FFMpeg-sharp), especially with non-video formats.
Does anyone have any ideas about tackling this issue, or maybe some alternatives? I don't believe my host (Arvixe) supports Python on its ASP.NET packages...
EDIT: I selected Jorge's answer as, with the comments as further context, it mostly answers my question.
There was already a discussion about that, your code can easily run even if asp.net was not mentioned, because in the end, asp.net is only on top of the .net framework.
How do I convert an M4A file to an MP3 or WMA file programmatically?
hope it helps,

The "correct" way of using multilingual support

I just began working with ASP.NET and I'm trying to bring with me some coding standards I find healthy. Among such standards there is the multilingual support and the use of resources for easily handling future changes.
Back when I used to code desktop applications, every text had to be translated, so it was a common practice to have the language files for every languages I would want to offer to the customers. In those files I would map every single text, from button labels to error messages. In ASP.NET, with the help of Visual Studio, I have the resort of using the IDE to generate such Resource Files (from Tools -> Generate Local Resource), but then I would have to fill my webpages with labels - at least that is what I've learned from articles and tutorials. However, such approach looks a bit odd and I'm tempted to guess it doesn't smell that good as well. Now to the question:
Should I keep every single text in my website as labels and manage its contents in the resource files? It looks/feels odd especially when considering a text with several paragraphs.
Whenever I add/remove something, e.g.: a button, to an aspx file I would have to add it to the resource file as well, because generating the resource file again would simply override all my previous changes to it. That doesn't feel like a reusable code at all for me.
Perhaps I got it all wrong from tutorials as it doesn't seem like a standardized matter - specially if it required recompiling the entire application whenever some change has to be done.
Best practices for ASP.NET Web Forms localization have not really changed much over the years. If you don't have much dynamic content then you can get away with implicit localization and bind web forms controls (form elements and yes, even labels) to resource files. Explicit localization is useful if you want a bit more control over where localized text is rendered in a control with multiple captions or something you've created yourself. You don't need to look very far for instructional steps from MS on how to do either of these.
Walkthrough: Using Resources for Localization with ASP.NET
If your localization requirements are more dynamic, for example, you want to easily provision new languages, centralize resources, or you need to provision new string captions on a new dimension (like per client), then you need to get a bit more creative. .NET allows you to extend the
the resource provider and you can implement a database backend that allows for easy administration of localized resources.
Extending the ASP.NET 2.0 Resource-Provider Model, Building a Database Resource Provider
Extending Resource-Provider for storing resources in the database * A more recent implementation
Or you could just roll your own!
I've also dug up a duplicate SO post. It's a few years old, but speaking from experience I believe the advice found on the referenced code project page are still true (for Web Forms): Globalization and localization demystified in ASP.NET 2.0
I hope that helps! If you have any more specific questions regarding localization please add them to your Questions or comments.

Upload file via HTTP from VBA (WinHTTP)

I'm trying to (HTTP) upload a binary file programmatically from within VBA. I intend to put an ASPX page on the server to accept the file and certain additional parameters.
I know there are lots of nice ways to do that (e.g. use web service instead of aspx), but my constraint is that it must run in VBA (in an excel file), and that I cannot install any additional components on the client.
So I guess I'll use WinHTTP, and I've found several examples to post form data, but not to post a binary file. I probably need to base64 the file contents?
So my questions are:
Do I need to do the encoding manually or can I make WinHTTP do that?
Is there a better utility to use than WinHTTP? (Remember I don't want to install any additional software, it must be shipped with WinXP Pro, Office 2007 or a .NET framework, e.g.)
Is there a better way to go, e.g. using ASP.NET web services?
Thx, chiccodoro
You may use base64 but typically writing binary is easier.
The hurdle you have to leap is constructing a valid multi-par/form POST. This is completely possible using WinHTTP, although I have not done it in years and am not tooled to provide sample code, it is not trivial.
You can reference the following articles for examples of how to do this with C# HttpWebRequest. The WinHTTP api is a bit different of course but the salient points to take away from the articles is the structure of the POST body.
C# File Upload with form fields, cookies and headers (by yours truly)
UploadFileEx: C#'s WebClient.UploadFile with more functionality (a bit more procedural and may be easier to suss out the format)
Typically I provide sample code, but as I said, I do not have any stone-age tools set up right now ;-).
HTH

Web-based .resx file editor?

I'm working on a SharePoint site, and the site eventually needs to be localized to many different languages. We can use resource files, but we'd like for the translators to be able to update those files while the site is live, without requiring developer assistance to recompile, redeploy, etc.
To me, I think the easiest way to do this would be to provide a web application to edit the .resx files as they sit in the App_GlobalResources directory. Does anyone know of some sort of a web-based .resx editor like that? I found one from LavaBlast, but it displays the values for all languages at once. With the number of languages we plan on having, I think that would eventually get unwieldy.
Any suggestions are appreciated.
I used the one you found: http://blog.lavablast.com/post/2008/02/RESX-file-Web-Editor.aspx It took a couple of hours but it works a treat. I think that having the multiple languages editable at the same time is very helpful to avoid getting your resx files out of sync, and to see blank entries easily.
Not a direct solution, but DotNetNuke contains a full lanaguage file editor, you might be able to extract the logic from it for your own use.
Microsoft released a tool called the Enterprise Localization Toolkit you might look at:
http://msdn.microsoft.com/en-us/library/aa479334.aspx
It has been ages since I played with it, but it should fit at least some of your requirements. It is easy enough for a non-techie to use. You do not edit RESX directly, however, so it might not be exactly what you need. You gen them instead and then deploy.

Resources