Tools used for processing content from PDF or Microsoft Word (DOC, DOCX), when parsing documents with images that have text labels overlaid on them, extract these labels separately to the images. The result is each such image being extracted without the overlaid text and then followed by one or more paragraphs of that text, out of context.
In such cases, an image like (a)
-------------
| Level 2 |
-------------
| Level 1 |
-------------
is extracted as (b)
-------------
| |
-------------
| |
-------------
Level 2
Level 1
This is "standard" behavior for tools used for PDF or Word processing, like Apache PDFBox and POI.
Is there any way of handling this, in the Apache tools, or any other similar tool?
The ideal solution would be to extract both the image and the labels as a single entity, like (a) above. Alternatively, image and label extraction could be deactivated together.
Ultimately, there should be way for avoiding the "pollution" of the document text with the labels, which otherwise appear out of content.
I recently discovered asciidoc as an amazing tool to create software documentation. Does anybody knows a way to draw screen prototype / GUI mockup?
Probably there is no direct integration like it is plantuml for diagrams. If so, is there a lean windows or linux tool to draw gui prototypes offline and export as vector graphic which can be imported within an asciidoc document?
I'm using ditaa for drawing: http://ditaa.sourceforge.net/
If the odds are good i'll start a project to bring some WYSIWYG =)
Ex:
- mockup name and age input fields
[ditaa]
--
/-------------------------\
| +---------------+ |
| name:| | |
| +---------------+ |
| |
| +---------------+ |
| age:| | |
| +---------------+ |
| |
|/----------------------\ |
|| Validate | |
|\----------------------/ |
| |
\-------------------------/
--
Render
The example above is really nice :-)
A WYSIWYG integration in eclipse can be found at
https://marketplace.eclipse.org/content/asciidoctor-editor
The output of the example inside editor looks like:
PS: I am the author of the mentioned plugin.
The https://plantuml.com/salt does exactly that. You have to include Asciidoc Diagram which is required for any PlantUml diagram.
Here is an example from the user guide:
#startsalt
{
Just plain text
[This is my button]
() Unchecked radio
(X) Checked radio
[] Unchecked box
[X] Checked box
"Enter text here "
^This is a droplist^
}
#endsalt
I tested it with the Intellij IDEA plugin, HTML5 and PDF backend with the maven plugin.
It works fine.
It generates WebP (https://developers.google.com/speed/webp) which might be a deal breaker for some as it is not widely adopted (e.g: imgur does not support).
Note: The guide uses the <b> for bold however Creole is supported so the ** works too.
I would like to implement a simple input box with SDL and SDL_ttf. Just like the address bar in your browser.
I'm guessing what is the easiest and most efficient way to detect a mouse selection with SDL_ttf.
Let say the box display text like this:
+--------+
| abcdef |
+--------+
The user clicks between 'c' and 'd', then it drags the mouse to the left by several pixels. Now I need to detect that it has selected the 'c' character.
The SDL_ttf library has several functions to determine the metrics of a text. You can compute the whole text size with TTF_SizeUTF8 and you can also determine a glyph size for an individual character with TTF_GlyphMetrics.
Rough idea would be to create a special array with all individual characters with their respective size just to determine their positions in the box.
Do you have better ideas on how this can be implemented easily?
Text selection in immediate rendering mode should be worked on from zero , which is alot of work to do. there is the legendary stb_textedit used by many immediate gui libraries like imgui , you can find it here
https://github.com/nothings/stb/blob/master/stb_textedit.h
I'm trying to place two images side-by-side, and ideally center the whole block in an Asciidoctor project. The code below works in the HTML5 output, but stacks the images when rendered to a PDF.
[.clearfix]
--
[.left]
.Title1
image::chapter3/images/foo.png[Foo, 450, scaledwidth="75%"]
[.left]
.Title2
image::chapter3/images/bar.png[Bar, 450, scaledwidth="75%"]
--
Is it possible to 1) render side-by-side images in a PDF and 2) center the block of images? If it's possible to specify the space between them, that would be great too.
Thanks,
Matt
Not sure if you can specify the space between them, but you're using the block image instead of the inline (image::...[] vs image:..[], note the colons). I'm also not sure how centring works in pdf as I don't do a lot of pdf generation, but if those are the only things on that line, they may center, or maybe a .center would do it?
1) render side-by-side images in a PDF
Yes. Following eskwayrd answer for Asciidoctor: how to layout two code blocks side by side? you can insert your image inside a table with only 2 columns.
[cols="a,a"]
|===
| image::foo.png[]
| image::bar.png[]
|===
I would in your case even completely hide the table
[cols="a,a", frame=none, grid=none]
|===
| image::foo.png[]
| image::bar.png[]
|===
2) center the block of images
This is currently complicated in PDF.
Well our block is now a table so we have a few options in HTML. Aligning the content with < and > is simple enough and works.
[cols=">a,<a", frame=none, grid=none]
|===
| image::foo.png[]
| image::bar.png[]
|===
Setting the table width to automatic and centering it also works in HTML:
[%autowidth, cols="a,a", frame=none, grid=none, role="center"]
|===
| image::foo.png[]
| image::bar.png[]
|===
These two methods however, for some reason, do not work in PDF when converting with asciidoctor-pdf. One "solution" for PDF would be to expand your table with extra empty columns left and right and trying to adjust their width with integers.
[cols="3,1a,1a,3", frame=none, grid=none]
|===
|
| image::foo.png[]
| image::bar.png[]
|
|===
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm a blind college student who is taking an introduction to programming class that focuses on user interface design. The class is using Processing, which is completely inaccessible. I'm looking for a language that will allow me to create GUI's without drag and drop and hopefully be smart enough to do most of the layout without forcing me to specify control positions in pixels.
I know Perl, Java, C/C++, c#, and HTML. I was considering creating HTA applications. My only requirements are that the language must run under MS Windows, and must not use SWING or GTK as the underlying toolkit.
I would say that xaml would be a good choice:
Pixel manipulation is not needed
Item functionality in code behind
Can add pixels changing for control
later on
There is a lot of documentation on
how to use it
Maybe if you give us an idea of what you will need the language for we can give you better suggestions.
Speaking as a blind programmer:
C# + WinForms: You can either create the code by hand and use layout managers or calculate the sizes in your head, or if you're using the JAWS screen reader then there are scripts which will help you in the WinForms designer.
C# + WPF: Here you define your UI in XML, but it is more complex to get your head around. Certainly look at this as it is a very nice solution. the other problem with WPF at the moment is that not all screen readers support this newer technology.
Jamal Mazrui at www.EmpowermentZone.com has created something called "Layout By Code", but I have no experience with this.
HTML+Javascript would be nice, but I doubt it'd be allowed in your course.
WXWidgets: I don't have a lot of experience with this cross-platform, multi-language UI toolkit, but I believe it has layout managers and is thus used by several blind programmers I know.
Finally, I used to design Win32 resource scripts by hand, calculating sizes in my head (no layout managers). This is certainly achievable if you wanted to take this route.
In summary, WPF's nice, but make sure your screen reader works with this kind of app. The next best alternative is probably WinForms. If you like Layout By Code then use it, but if this is a skill you want for employment, then keep that in mind.
take a look on XAML. I think it could be a good start for both modern Windows and Web UI creators.
Tcl/Tk will do exactly what you want. The pack and grid layout managers are based on logical relative placement of the widgets.
Although the "native" language of Tk is Tcl, many other languages have a Tk binding.
label .l -text "this is a label"
button .b -text 'quit' -command "exit"
pack .l .b
Check out this project on codeplex. It may help you (as an alternative to processing&java)
http://bling.codeplex.com/
ling is a C#-based library for easily programming images, animations, interactions, and visualizations on Microsoft's WPF/.NET. Bling is oriented towards design technologists, i.e., designers who sometimes program, to aid in the rapid prototyping of rich UI design ideas. Students, artists, researchers, and hobbyists will also find Bling useful as a tool for quickly expressing ideas or visualizations. Bling's APIs and constructs are optimized for the fast programming of throw away code as opposed to the careful programming of production code.
Bling as the following features that aid in the rapid prototyping of rich UIs:
* Declarative constraints that maintain dynamic relationships in the UI without the need for complex event handling. For example, button.Width = 100 - slider.Value causes button to shrink as the slider thumb is moved to the right, or grow as it is moved to the left. Constraints have many benefits: they allow rich custom layouts to be expressed with very little code, they are easy animate, and they support UIs with lots of dynamic behavior.
* Simplified animation with one line of code. For example, button.Left.Animate.Duration(500).To = label.Right will cause button to move to the right of label in 500 milliseconds.
* Pixel shader effects without the need to write HLSL code or boilerplate code! For example, canvas.CustomEffect = (input, uv) => new ColorBl(new Point3DBl(1,1,1) - input[uv].ScRGB, input[uv].ScA); defines and installs a pixel shader on a canvas that inverts the canvas's colors. Pixel shading in Bling takes advantage of your graphics card to create rich, pixel-level effects.
* Support for multi-pass bitmap effects such as diffuse lighting.
* An experimental UI physics engine for integrating physics into user interfaces! The physics supported by Bling is flexible, controllable, and easy to program.
* Support for 2.5D lighting.
* A rich library of geometry routines; e.g., finding where two lines intersect, the base of a triangle, the area of triangle, or a point on Bezier curve. These routines are compatible with all of Bling's features; e.g., they can be used in express constraints, pixel shaders, or physical constraints. Bling also provides a rich API for manipulating angles in both degrees and radians.
* And many smaller things; e.g., a frame-based background animation manager and slide presentation system.
* As a lightweight wrapper around WPF, Bling code is completely compatible with conventional WPF code written in C#, XAML, or other .NET languages.
Bling is an open source project created by Sean McDirmid and friends to aid in design rapid prototyping. We used Bling to enhance our productivity and would like to share it with other WPF UI design prototypers.
I'd probably try using C#. It has reasonably friendly interfaces to windows common controls and the like even without making use of Drag and Drop. Just don't make use of the designer and code as normal.
I don't program in Java but I know that Java provides for the programmatic creation of the UI AND provides some wonderful Layout Management components (Native to Java without requiring SWING). I first got exposed to Layout Managers back in the good-old-days of X11 with X Toolkits (anybody remember Motif, OpenLook, HP Open View?) and Java seems to have adopted similar technology.
You can create Windows, Dialogs and Menus all from simple layout managers.
Being sighted myself and not having worked too closely on anything that has ever been audited for accessibility or heavily accessed by blind users, I don't think my answer will be terribly thorough. My first instinct however is to say that some kind of dynamic web server architecture that generates HTML like C#, PHP or ColdFusion is going to fit your description of handling most of the layout for you without requiring that you specify control positions in pixels. There certainly is the availability to specify control positions in pixels via CSS, but it's not required. And I know HTML also has well defined standards for accessibility, whereas I'm not sure what the status is on accessibility standards with other kinds of software.
You could use javascript and html. There's a port of processing to javascript, so you know that it is powerful enough for the things that your class will cover. You can author html without knowing a single thing about what it looks like. In fact that is the preferred way to author html.
The main downside of javascript is not javascript itself, but the browser dom. That is the interface into controlling the html elements. However, a library like jquery, or mootools, or dojo can take care of most of those problems.
As for accessiblity, have a look at WAI ARIA also opera's intro to WAI ARIA.a
WAI ARIA is a way to build rich javascript applications while playing nice with screen readers. It's very cool. I've not seen more work and passion put into making the web stack accessible in any other programming stack.