Best way to create/fill-in printed forms and pdfs?

前端 未结 8 692
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 15:17

We have a C# application that must print complex forms. Things like multi-page government compliance forms that must be in a specific format. We can get PDF copies of these fo

8条回答
  •  猫巷女王i
    2021-02-02 15:51

    1. Print the PDF form (in high quality)
    2. Scan it (in high quality)
    3. Convert scanned file into a bitmap (*.dib)
    4. Using Visual C (VS 2010, programmatically)
      • set the page properties (i.e., prepare the page, device context, etc...)
      • create your fonts (as many as you like, of course)
      • set the page origin (top of page)
      • load and use StretchDIBits (or similar) to print the PDF page image
      • go to top of page
      • calculate your print position (pt.x and pt.y)
      • print using pDC->TextOut (or whatever else you want to use)

    The above does work with any number of fields on any PDF page but requires some rudimentary knowledge of the underlying OS print processes. It gives you full control of the page and that does mean you can cross out, print over, etc.... you can do whatever you like.
    I see no problem whatsoever in converting that to VS 2017 and C#. No library needed - just plain old fashioned coding by hand.

提交回复
热议问题