Printing booklet, 2 side 2 sheet xubuntu 14

print_booklet-with-evince

Here is my python script to successfully print booklet.

  1. thanks to : http://askubuntu.com/questions/214538/printing-in-booklet-format

page = 8 # how many page do you have? minimum is 1
start = 35 # book start from page? 3-18, 19-34, 35-66
p = []
for i in range( page*4) :
  p.append( i+start )

l = (len( p ) / 4)
dl = len(p)-1
out = ""
for a in range( l ) :
out = out + str(p[dl-a*2]) + "," + str(p[a*2]) + "," + str(p[a*2+1]) + "," + str(p[dl-a*2-1]) +","

print out[:-1] # ommit last comma

# array to check wether that algorithm accurate
def confirm() :
  v4 = [ 4,1,2, 3 ]
  v8 = [ 8,1,2, 7, 6,3,4, 5 ] # booklet 8 pages, 2 sided, 2 sheet per page
  v16 = [16,1,2,15, 14,3,4,13, 12,5,6,11, 10,7,8,9 ]
  v32 = [32,1,2,31, 30,3,4,29, 28,5,6,27, 26,7,8,25, 24,9,10,23, 22,11,12,21, 20,13,14,19, 18,15,16,17]

  s8 = [ 1,2,3,4, 5,6,7,8 ] # sorted
  s16 = [ 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16 ] # sorted
  s32 = [ 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16, 17,18,19,20, 21,22,23,24, 25,26,27,28, 29,30,31,32 ] # sorted

Deconstruct the skill: on Video Processing

Bismillah.

Always start as simple as possible to feel confortable. For example you can implement correct h264 format in 30 lines. Then you can move to making video player on 1000 lines. If you want expand the app with SDL, tutorial also available.

Here are some usefull links for your journey:

https://trac.ffmpeg.org/wiki/CompilationGuide/CrossCompilingForWindows
http://ffmpeg.gusari.org/viewtopic.php?f=8&t=1663
http://superuser.com/questions/675876/ffmpeg-minimal-requirements-configuration-for-encoding-and-decoding-h264-files
https://www.ffmpeg.org/platform.html#Native-Windows-compilation-using-MinGW-or-MinGW_002dw64
https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=1789
http://tech.yipp.ca/linux/how-to-statically-link-sdl-dll-into-your-application/
http://stackoverflow.com/questions/18805155/tdm-gcc-w64-script-to-change-windres-for-32bit
https://forums.libsdl.org/viewtopic.php?t=9667&sid=338f32cd7496c76e929558321ae63c38
https://drangertuts.wordpress.com/2011/05/07/introduction/
https://forums.libsdl.org/viewtopic.php?t=5278&sid=f3f11d4313b69575c57ec570a65f89d4

VC++6 : Mix C and C++ header rule

Its just my hypotesis . C++ need  “filename.h”  in header file while  C  can accept <filename.h>

How can we mix code that contain C and C++

My best solution until now is having 2 include file. One with <filename.h>  format and one with  “filename.h ” although

the content is exactly same

Any better idea?