For your application, WriteElement will give the wrong result, since each element will add an additional translation, resulting in a 'staircase' effect.
WritePlacedElement also gives the wrong result, because you end up discarding relevant GState information, such as selected font and text matrix. Instead, what you need is to only reset the GState transform, not the entire GState.
I wrote a test implementation in python that does just that. It should be relatively straightforward to map the implementation to VB:
def ProcessElements(reader, writer):
element = reader.Next() # Read page contents
#We will store the inverse to our translation, so we can undo it later
inverse_transform = Matrix2D(1,0,0,1,0,0)
while element != None:
#Apply the inverse transform to undo the translation
mtx = element.GetGState().GetTransform()
mtx = inverse_transform * mtx
element.GetGState().SetTransform(mtx)
#There is no longer a translation to inverse, so we set inverse_transform back to identity
inverse_transform = Matrix2D(1,0,0,1,0,0)
type = element.GetType()
if type == Element.e_text or type == Element.e_image:
#We want to translate text and images, so here we go:
mtx.Concat(1,0,0,1,0,-150)
element.GetGState().SetTransform(mtx)
writer.WriteElement(element)
#We now need to set the inverse transform:
inverse_transform = Matrix2D(1,0,0,1,0,150)
elif type == Element.e_form: # Recursively process form XObjects
writer.WriteElement(element)
reader.FormBegin()
ProcessElements(reader, writer)
reader.End()
else:
writer.WriteElement(element)
element = reader.Next()
To help you with debugging, I would recommend you use a tool such as CosEdit, which allows you to browse the internal structure of a pdf document: http://www.pdftron.com/pdfcosedit
With this tool, and a good understanding of the PDF specification, you can easily visualize how different routines are modifying the PDF, which should make your development process more productive.
Nothing after
this point appears in the output document...
Element(e_group_begin:)
Element(e_form:Rect(x1=0,x2=8.5,y1=0,y2=11))
Element(e_group_begin:)
Element(e_form:Rect(x1=1.57606944444444,x2=2.42531944444444,y1=8.65619402777778,y2=8.86541625))
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=1.57606944444444,x2=2.42531944444444,y1=8.65619402777778,y2=8.86541625))
Element(e_path:Rect(x1=1.57606944444444,x2=2.42531944444444,y1=8.65619402777778,y2=8.86541625))
Element(e_group_begin:)
Element(e_path:Rect(x1=1.58995833333333,x2=2.41143055555556,y1=8.67008291666667,y2=8.85152736111111))
Element(e_group_begin:)
Element(e_text_begin:)
Element(e_text:Text("612"),Rect(x1=1.60384722222222,x2=1.81234722222222,y1=8.69080513888889,y2=8.80643013888889))
Element(e_text_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_marked_content_end:)
Element(e_form:Rect(x1=3.34340291666667,x2=4.54458347222222,y1=8.65619402777778,y2=8.86541625))
Element(e_group_begin:)
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=3.34340291666667,x2=4.54458347222222,y1=8.65619402777778,y2=8.86541625))
Element(e_path:Rect(x1=3.34340291666667,x2=4.54458347222222,y1=8.65619402777778,y2=8.86541625))
Element(e_group_begin:)
Element(e_path:Rect(x1=3.35729180555556,x2=4.53069458333333,y1=8.67008291666667,y2=8.85152736111111))
Element(e_text_begin:)
Element(e_text_new_line:)
Element(e_text:Text("10/03/18"),Rect(x1=3.37118069444444,x2=3.85768069444444,y1=8.69080513888889,y2=8.80643013888889))
Element(e_text_end:)
Element(e_marked_content_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_form:Rect(x1=0.524436111111111,x2=7.41715833333333,y1=7.63173597222222,y2=8.02845819444445))
Element(e_group_begin:)
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=7.63520819444445,y2=8.02498597222222))
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=7.63520819444445,y2=8.02498597222222))
Element(e_group_begin:)
Element(e_path:Rect(x1=0.555686111111111,x2=7.38590833333333,y1=7.63520819444445,y2=7.97220819444444))
Element(e_text_begin:)
Element(e_text_new_line:)
Element(e_text:Text("DEROGATORY
PUBLIC RECORD OR COLLECTION
FILED"),Rect(x1=0.555686111111111,x2=3.95206111111111,y1=7.76051375,y2=7.87613875))
Element(e_text_end:)
Element(e_marked_content_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_form:Rect(x1=0.524436111111111,x2=7.41715833333333,y1=7.31334680555556,y2=7.71006902777778))
Element(e_group_begin:)
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=7.31681902777778,y2=7.70659680555555))
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=7.31681902777778,y2=7.70659680555555))
Element(e_group_begin:)
Element(e_path:Rect(x1=0.555686111111111,x2=7.38590833333333,y1=7.31681902777778,y2=7.65381902777778))
Element(e_text_begin:)
Element(e_text_new_line:)
Element(e_text:Text("PROPORTION
OF BALANCE TO HIGH CREDIT ON BANK REVOLVING OR ALL REVOLVING
ACCOUNTS"),Rect(x1=0.555686111111111,x2=6.61943611111111,y1=7.41434680555556,y2=7.52997180555556))
Element(e_text_end:)
Element(e_marked_content_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_form:Rect(x1=0.524436111111111,x2=7.41715833333333,y1=6.99495819444444,y2=7.39168041666667))
Element(e_group_begin:)
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=6.99843041666667,y2=7.38820819444444))
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=6.99843041666667,y2=7.38820819444444))
Element(e_group_end:)
Element(e_text_begin:)
Element(e_text_new_line:)
Element(e_text:Text("LENGTH OF TIME
ACCOUNTS HAVE BEEN
ESTABLISHED"),Rect(x1=0.5897,x2=4.02095,y1=7.09112486111111,y2=7.20674986111111))
Element(e_text_end:)
Element(e_marked_content_end:)
Element(e_group_end:)
Element(e_form:Rect(x1=0.524436111111111,x2=7.41715833333333,y1=6.67656958333333,y2=7.07329180555555))
Element(e_group_begin:)
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=6.68004180555555,y2=7.06981958333333))
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=6.68004180555555,y2=7.06981958333333))
Element(e_group_begin:)
Element(e_path:Rect(x1=0.555686111111111,x2=7.38590833333333,y1=6.68004180555555,y2=7.01704180555555))
Element(e_text_begin:)
Element(e_text_new_line:)
Element(e_text:Text("TOO MANY
INQUIRIES LAST 12
MONTHS"),Rect(x1=0.555686111111111,x2=2.99368611111111,y1=6.73590291666667,y2=6.85152791666667))
Element(e_text_end:)
Element(e_marked_content_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_form:Rect(x1=0.527908333333333,x2=7.41368055555555,y1=6.36165277777778,y2=6.75143055555556))
Element(e_group_begin:)
Element(e_marked_content_begin:)
Element(e_group_begin:)
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=6.36165277777778,y2=6.75143055555556))
Element(e_path:Rect(x1=0.527908333333333,x2=7.41368611111111,y1=6.36165277777778,y2=6.75143055555556))
Element(e_marked_content_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)
Element(e_group_end:)