Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i want to split pdf file into mulitple file like 1.pdf,2.pdf in vb.net 2010 my code is as under. i have counted lines of a pdf docs and total bytes of the pdf docs. now how to split it
VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Dim infoReader As System.IO.FileInfo = _
   My.Computer.FileSystem.GetFileInfo("C:\Users\nhbg\Desktop\RamNiwas\AccessTutorial.pdf")
       Label1.Text = infoReader.Length

       Dim data() As String = IO.File.ReadAllLines("C:\Users\nhbg\Desktop\RamNiwas\AccessTutorial.pdf")
       For Each lines As String In data
           Dim splt As String() = lines.Split(" ,")


       Next
Posted

1 solution

PDF and DOCX files are not text files, to be split using string functions. :-)

To work with PDF, please see this set of referenced to PDF libraries you can use: http://csharp-source.net/open-source/pdf-libraries.

To work with .docx, please see:
https://msdn.microsoft.com/en-us/library/office/bb448854.aspx[^],
http://www.microsoft.com/en-us/download/details.aspx?id=30425[^],
http://openxmldeveloper.org[^].

Open Source from Microsoft Open Technologies: https://github.com/OfficeDev/Open-XML-SDK[^].

Now, about reading a Word document: https://msdn.microsoft.com/en-us/library/office/ff478541.aspx[^].

This CodeProject article can also be useful: Edit Word Documents using OpenXML and C# Without Automation/Interop[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900