The author analyzes modern approaches to document processing in libraries and archives with the focus on further long-term preservation of digital materials. The purpose of the study is to develop classification methodology for heterogeneous digital materials in the collections. Two key scenarios are examined: obtaining scan rasters (unrecognized documents), or normalization of digital documents in DOCX, ODT, etc., formats. The emphasis is made on PDF/A-2b standard as an optimum for archiving text and hybrid documents. The practical value of the study is that the processing algorithm is generated; it comprises three major stages: preliminary optimization of native files (file clearance, chopping, script and metadata normalization); conversion to recommended format for long-term storage; further checkup for ISO 19005 compliance. The significant result is selection of open source instruments, e. g. GraphicsMagick, Ghostscript, LibreOffice, OCRmyPDF, and veraPDF that enable big array processing automation. The author also discusses compatibility of the mentioned instruments with Russian software and law provisions. She emphasizes that open source software is economically feasible for the Russian libraries.