On Fr, 2015-09-25 at 14:28 -0400, Steve wrote: > Regarding placement of the checkboxes: I will just make a script that > enumerates questions by id (as opposed to question text, which can > become multiline and complex...) that does the hspaces and vspaces > (your latex macros do not abide textpos; or should I say texpos does > not abide your macros??)
I have no idea. Most positioning code should probably work just fine
with the \checkbox command. I would assume that even placing things
anywhere on the page with a tikz node should work.
Anyway, I don't have the time to investigate further on how to properly
do this (with the old class). Just would like to point you to the
"annotate" command, that may help you to check whether everything is
working correctly.
> With regards to writing a wrapper script, etc. etc. I see that at an
> earlier step you would need to introduce a "style" attribute to the
> images.
>
> But rather than muck with all of that, I found a much simpler code
> mod to sdaps that appears to work; feel free to critique and
> _constructively_ suggest any more efficient or "proper" alternative.
> In recognize/buddies.py:
There is nothing new to suggest; I already said how you should solve
the issue in my opinion. The fact that you found the below workaround
actually just shows to me that the code is working as expected, and
also that my suggestion to execute blank.py instead of the normal
sdaps.py will work just fine.
Removing the "hasattr" check is completely irrelevant here; the "style"
attribute "magically" appears when the code from "blank.py" is loaded.
Which is why you were supposed to use it as a wrapper instead of
running the normal sdaps executable. Loading it in some other way (i.e.
adding an import pretty much anywhere) will also work, but using the
wrapper means you don't need to modify the SDAPS core.
> elif self.obj.sheet.survey.defs.style == "custom":
> import blank # MOD: when you specify "style=custom",
> sdaps now uses the "blank" style...
> ## if not hasattr(self.obj, "style"):
> ## import sys
> ## log.error(_("No style buddy loaded. This needs to
> be done for the \"custom\" style!"))
> ## sys.exit(1)
> else:
> raise AssertionError
>
> On 9/24/2015 3:28 PM, Steve wrote:
> > "The second step requires a wrapper script that is run instead of
> > the normal sdaps executable. It simply loads an implementation for
> > the required functions that will be used later and then runs SDAPS
> > normally."
> > Can I get an elaboration on that? I see blank.py in my recognize
> > subfolder for sdaps; the functions in it make sense.
> > What made sense to me was to change the tex style to blank
> > ("style=blank"...) That didn't work.
> >
> > I can do a setup_tex with style set to custom; but when I go to do
> > a recognize I get: "Error: No style buddy loaded. This needs to be
> > done for the 'custom' style!"
> >
> >
> > On 9/23/2015 9:16 AM, Benjamin Berg wrote:
> > > On Mi, 2015-09-23 at 09:12 -0400, Steve wrote:
> > > > Thanks for the answer on the rotation.
> > > >
> > > > So how can I adjust the box locations immediately after
> > > > setup_tex to be
> > > > at specific locations?
> > > > (or how can I designate through a choiceitem directive the
> > > > coordinate
> > > > locations of checkboxes, without necessitating that the latex
> > > > generate
> > > > content that offsets the checkbox to the same location...)
> > > It just does not work the like that. SDAPS is designed to only
> > > handle
> > > one specific layout, and there is no code in place to modify the
> > > checkbox locations on the fly.
> > >
> > > Benjamin
> > >
> > > > On 9/23/2015 9:04 AM, Benjamin Berg wrote:
> > > > > On Di, 2015-09-22 at 09:32 -0400, Steve wrote:
> > > > > > I need to do it without those two small squares that
> > > > > > "classic"
> > > > > > mode
> > > > > > prints at the top. The crossmark lines are OK.
> > > > > >
> > > > > > So is there a way to accept pages that are insured by an
> > > > > > operator
> > > > > > to
> > > > > > be fed with a particular consistent rotational orientation
> > > > > > and
> > > > > > side?
> > > > > > Evaluation of the corner crossmarks by sdaps can be used to
> > > > > > insure
> > > > > > that the boxes are in positional alignment on the page (by
> > > > > > x and
> > > > > > y...); but no barcodes and no small boxes in the corner.
> > > > > If you really want to, you can. But you really need to make
> > > > > sure
> > > > > that
> > > > > all pages are scanned correctly. There are no safeguards in
> > > > > place
> > > > > once
> > > > > you disable the barcode reading.
> > > > >
> > > > > But if you want to, there is even a file that shows how it
> > > > > can be
> > > > > done.
> > > > > The steps involved are:
> > > > > 1. Switch to "custom" style.
> > > > > 2. Preload script that implements your "custom" style.
> > > > >
> > > > > The first part is as simple as putting "style=custom" into
> > > > > the
> > > > > latex
> > > > > document. The second step requires a wrapper script that is
> > > > > run
> > > > > instead
> > > > > of the normal sdaps executable. It simply loads an
> > > > > implementation
> > > > > for
> > > > > the required functions that will be used later and then runs
> > > > > SDAPS
> > > > > normally.
> > > > >
> > > > > There is an example "blank.py" in sdaps/sdaps/recognize.py
> > > > > which
> > > > > just
> > > > > assume first page and correct rotation.
> > > > >
> > > > > Note that you may need to grab the git checkout, as the file
> > > > > is not
> > > > > in
> > > > > the release tarball.
> > > > >
> > > > > > And separately: can I edit questionnaire.sdaps after
> > > > > > project
> > > > > > setup,
> > > > > > to reflect possibly new box locations??
> > > > > Nope, it is only read once at setup time. I have some
> > > > > (currently
> > > > > still
> > > > > private) example that reads a .csv file with checkbox
> > > > > definitions
> > > > > on
> > > > > the fly, does a recognize step and outputs the data as XML.
> > > > > It uses
> > > > > a
> > > > > custom style which assumes a QR code in the top left corner.
> > > > > (The
> > > > > form
> > > > > would be created manually using another method.)
> > > > >
> > > > > If people are interested, please ping me, and I'll polish it
> > > > > a bit
> > > > > so
> > > > > that it can be published.
> > > > >
> > > > > Benjamin
> > > > >
> > > > > > On 9/22/2015 8:15 AM, Terrence Kovacs wrote:
> > > > > > > I am using sdaps w/o the barcode with this documentclass
> > > > > > > line:
> > > > > > >
> > > > > > > \documentclass[english,pagemark,stamp,final,letterpaper,n
> > > > > > > o_prin
> > > > > > > t_su
> > > > > > > rvey_id,style=classic]{sdaps}
> > > > > > >
> > > > > > > Corner marks are printed to orient the page.
> > > > > > >
> > > > > > > Terrence Kovacs
> > > > > > > Research Systems Engineer
> > > > > > > Physics and Astronomy Department
> > > > > > > Dartmouth College
> > > > > > > Wilder 341, 603-646-9303
> > > > > > >
> > > > > > >
> > > > > > > From: Steve <[email protected]>
> > > > > > > Sent: Monday, September 21, 2015 5:39 PM
> > > > > > > To: [email protected]
> > > > > > > Subject: Re: [sdaps] Inspection of Page Number and
> > > > > > > Orientation...
> > > > > > > (#82)
> > > > > > >
> > > > > > > This is sort of related to my previous page orientation
> > > > > > > question
> > > > > > > (which is not working yet; but let me bring this question
> > > > > > > to
> > > > > > > the
> > > > > > > fore...):
> > > > > > >
> > > > > > > In sdaps.cls, there is a comment:
> > > > > > > % We unconditionally print this barcode; it is required
> > > > > > > for the
> > > > > > > recognition process...
> > > > > > > And sure enough: if I comment out the bar code and
> > > > > > > attempt a
> > > > > > > scan,
> > > > > > > checkmarks don't get recognized
> > > > > > > (but note that I left the corner crossmarks from the
> > > > > > > stamp
> > > > > > > process
> > > > > > > in place...)
> > > > > > >
> > > > > > > My question is: if I feed all my documents to be oriented
> > > > > > > in a
> > > > > > > uniformly consistent way (and perhaps even pass a hint to
> > > > > > > sdaps
> > > > > > > as
> > > > > > > to how they are oriented on the feeder?), can I get sdaps
> > > > > > > to
> > > > > > > recognize the checkmarks without the barcode?
> > > > > > >
> > > > > > > An interrelated question: I see in questionnaire.sdaps
> > > > > > > that
> > > > > > > coordinates for the checkboxes get defined during the
> > > > > > > setup
> > > > > > > process.
> > > > > > > If I adjust the coordinates in this file, will a
> > > > > > > subsequent
> > > > > > > scan
> > > > > > > read from those new locations??
signature.asc
Description: This is a digitally signed message part
