Hello, I was testing some dwg files and found entities are  splitted into different parts in dwg2dxf.
### case 1
weiken@B-M71PMD6M-1836 libredwg-0.12.5.5759 % programs/dwg2dxf -o ~/Downloads/test_021.dxf  ~/Downloads/test_021.dwg
Reading DWG file /Users/weiken/Downloads/test_021.dwg
Warning: checksum: 0x2cc512c3 (calculated) mismatch

Warning: Invalid sections: 0 != numgaps: 0 + numsections: 22
ERROR: Invalid .props x 9576

Warning: Ignore invalid handleoff (@4072)
Warning: Ignore invalid handleoff (@6107)
Warning: Ignore invalid handleoff (@7705)
Warning: Unstable Class object 511 MATERIAL (0x400) 4105/0
Warning: Unstable Class object 511 MATERIAL (0x400) 4106/0
Warning: Unstable Class object 511 MATERIAL (0x400) 4107/0
Warning: Unstable Class object 513 TABLESTYLE (0xfff) 4127/0
ERROR: Invalid .files x 349500452

Warning: Skip empty section 0 AcDb:Template
Writing DXF file /Users/weiken/Downloads/test_021.dxf
Warning: Unstable Class object 511 MATERIAL (0x400) 4105/2C5F2
Warning: Unstable Class object 511 MATERIAL (0x400) 4106/2C5F3
Warning: Unstable Class object 511 MATERIAL (0x400) 4107/2C5F4
Warning: Unstable Class object 513 TABLESTYLE (0xfff) 4127/2C608

origin dwg file open with AutoCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/c16b593e-411d-4b9b-b1d1-26e1dcb7f231)

converted dxf file open with LibreCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/7069897f-5e41-41db-89a1-d185df5a812c)

### case 2
weiken@B-M71PMD6M-1836 libredwg-0.12.5.5759 % programs/dwg2dxf -o ~/Downloads/test1.dxf  ~/Downloads/test1.dwg -y
Reading DWG file /Users/weiken/Downloads/test1.dwg
Warning: checksum: 0x26ef124d (calculated) mismatch

Warning: Invalid sections: 0 != numgaps: 0 + numsections: 388
ERROR: Invalid .props x 9581

ERROR: Invalid LWPOLYLINE.num_points 38737
ERROR: bit_read_RC buffer overflow at 4996.0 + 1 > 4996
Warning: Ignore invalid handleoff (@136343)
Warning: Ignore invalid handleoff (@138378)
Warning: Ignore invalid handleoff (@140412)
Warning: Ignore invalid handleoff (@142448)
Warning: Ignore invalid handleoff (@144482)
Warning: Ignore invalid handleoff (@146518)
Warning: Ignore invalid handleoff (@148552)
Warning: Ignore invalid handleoff (@150586)
Warning: Ignore invalid handleoff (@152624)
Warning: Ignore invalid handleoff (@154660)
Warning: Ignore invalid handleoff (@156694)
Warning: Ignore invalid handleoff (@158728)
Warning: Ignore invalid handleoff (@160763)
Warning: Ignore invalid handleoff (@162798)
Warning: Ignore invalid handleoff (@164832)
Warning: Ignore invalid handleoff (@166866)
Warning: Ignore invalid handleoff (@168901)
Warning: Ignore invalid handleoff (@170936)
Warning: Ignore invalid handleoff (@172970)
Warning: Ignore invalid handleoff (@175004)
Warning: Ignore invalid handleoff (@177040)
Warning: Ignore invalid handleoff (@179074)
Warning: Ignore invalid handleoff (@181108)
Warning: Ignore invalid handleoff (@183142)
Warning: Ignore invalid handleoff (@185176)
Warning: Ignore invalid handleoff (@187213)
Warning: Ignore invalid handleoff (@189248)
Warning: Ignore invalid handleoff (@191282)
Warning: Ignore invalid handleoff (@193316)
Warning: Ignore invalid handleoff (@195350)
Warning: Ignore invalid handleoff (@197385)
Warning: Ignore invalid handleoff (@199420)
Warning: Ignore invalid handleoff (@201454)
Warning: Ignore invalid handleoff (@203489)
Warning: Ignore invalid handleoff (@205524)
Warning: Ignore invalid handleoff (@207559)
Warning: Ignore invalid handleoff (@209593)
Warning: Ignore invalid handleoff (@211628)
Warning: Ignore invalid handleoff (@213663)
Warning: Ignore invalid handleoff (@215697)
Warning: Ignore invalid handleoff (@217731)
Warning: Ignore invalid handleoff (@219766)
ERROR: bit_read_RC buffer overflow at 4995.0 + 1 > 4995
Warning: Ignore invalid handleoff (@221800)
Warning: Ignore invalid handleoff (@223835)
Warning: Ignore invalid handleoff (@225869)
Warning: Ignore invalid handleoff (@227904)
Warning: Ignore invalid handleoff (@229938)
Warning: Ignore invalid handleoff (@231973)
Warning: Ignore invalid handleoff (@234007)
Warning: Ignore invalid handleoff (@236041)
Warning: Ignore invalid handleoff (@238075)
Warning: Ignore invalid handleoff (@240110)
Warning: Ignore invalid handleoff (@242146)
Warning: Ignore invalid handleoff (@244183)
Warning: Ignore invalid handleoff (@246220)
ERROR: bit_read_RC buffer overflow at 4995.0 + 1 > 4995
Warning: Ignore invalid handleoff (@248254)
Warning: Ignore invalid handleoff (@250288)
Warning: Ignore invalid handleoff (@252322)
Warning: Ignore invalid handleoff (@254356)
Warning: Ignore invalid handleoff (@256394)
Warning: Ignore invalid handleoff (@258430)
Warning: Ignore invalid handleoff (@260465)
Warning: Ignore invalid handleoff (@262500)
Warning: Ignore invalid handleoff (@264535)
Warning: Ignore invalid handleoff (@266570)
Warning: Ignore invalid handleoff (@268605)
Warning: Ignore invalid handleoff (@270642)
Warning: Ignore invalid handleoff (@272679)
Warning: Ignore invalid handleoff (@274714)
Warning: Ignore invalid handleoff (@276749)
Warning: Ignore invalid handleoff (@278787)
Warning: Ignore invalid handleoff (@280822)
Warning: Ignore invalid handleoff (@282857)
Warning: Ignore invalid handleoff (@284892)
Warning: Ignore invalid handleoff (@286928)
Warning: Unstable Class object 559 MATERIAL (0x400) 112842/0
Warning: Unstable Class object 559 MATERIAL (0x400) 112843/0
Warning: Unstable Class object 559 MATERIAL (0x400) 112844/0
Warning: Unstable Class object 561 TABLESTYLE (0xfff) 112863/0
Warning: Ignore invalid handleoff (@288963)
ERROR: Invalid .files x 3709541268

Warning: Skip empty section 0 AcDb:Template
Writing DXF file /Users/weiken/Downloads/test1.dxf
ERROR: Invalid SAB
Warning: Empty REGION.history_id

ERROR: Invalid SAB
Warning: Empty REGION.history_id

ERROR: Invalid SAB
Warning: Empty REGION.history_id

Warning: Unstable Class object 559 MATERIAL (0x400) 112842/74D36
Warning: Unstable Class object 559 MATERIAL (0x400) 112843/74D37
Warning: Unstable Class object 559 MATERIAL (0x400) 112844/74D38
Warning: Unstable Class object 561 TABLESTYLE (0xfff) 112863/74D4B

origin dwg file open with AutoCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/f582e45d-836e-46a8-8ea8-19e0cf8eb51c)

converted dxf file open with LibreCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/924e74ea-1b25-43f6-a661-a4fd55e20bf7)

### attachment
[samples.tar.gz](https://github.com/LibreDWG/libredwg/files/11720823/samples.tar.gz)

To dxf entities are splitted into different parts
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : To dxf entities are splitted into different parts
Issue date:

--- start body ---
Hello, I was testing some dwg files and found entities are  splitted into different parts in dwg2dxf.
### case 1
weiken@B-M71PMD6M-1836 libredwg-0.12.5.5759 % programs/dwg2dxf -o ~/Downloads/test_021.dxf  ~/Downloads/test_021.dwg
Reading DWG file /Users/weiken/Downloads/test_021.dwg
Warning: checksum: 0x2cc512c3 (calculated) mismatch

Warning: Invalid sections: 0 != numgaps: 0 + numsections: 22
ERROR: Invalid .props x 9576

Warning: Ignore invalid handleoff (@4072)
Warning: Ignore invalid handleoff (@6107)
Warning: Ignore invalid handleoff (@7705)
Warning: Unstable Class object 511 MATERIAL (0x400) 4105/0
Warning: Unstable Class object 511 MATERIAL (0x400) 4106/0
Warning: Unstable Class object 511 MATERIAL (0x400) 4107/0
Warning: Unstable Class object 513 TABLESTYLE (0xfff) 4127/0
ERROR: Invalid .files x 349500452

Warning: Skip empty section 0 AcDb:Template
Writing DXF file /Users/weiken/Downloads/test_021.dxf
Warning: Unstable Class object 511 MATERIAL (0x400) 4105/2C5F2
Warning: Unstable Class object 511 MATERIAL (0x400) 4106/2C5F3
Warning: Unstable Class object 511 MATERIAL (0x400) 4107/2C5F4
Warning: Unstable Class object 513 TABLESTYLE (0xfff) 4127/2C608

origin dwg file open with AutoCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/c16b593e-411d-4b9b-b1d1-26e1dcb7f231)

converted dxf file open with LibreCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/7069897f-5e41-41db-89a1-d185df5a812c)

### case 2
weiken@B-M71PMD6M-1836 libredwg-0.12.5.5759 % programs/dwg2dxf -o ~/Downloads/test1.dxf  ~/Downloads/test1.dwg -y
Reading DWG file /Users/weiken/Downloads/test1.dwg
Warning: checksum: 0x26ef124d (calculated) mismatch

Warning: Invalid sections: 0 != numgaps: 0 + numsections: 388
ERROR: Invalid .props x 9581

ERROR: Invalid LWPOLYLINE.num_points 38737
ERROR: bit_read_RC buffer overflow at 4996.0 + 1 > 4996
Warning: Ignore invalid handleoff (@136343)
Warning: Ignore invalid handleoff (@138378)
Warning: Ignore invalid handleoff (@140412)
Warning: Ignore invalid handleoff (@142448)
Warning: Ignore invalid handleoff (@144482)
Warning: Ignore invalid handleoff (@146518)
Warning: Ignore invalid handleoff (@148552)
Warning: Ignore invalid handleoff (@150586)
Warning: Ignore invalid handleoff (@152624)
Warning: Ignore invalid handleoff (@154660)
Warning: Ignore invalid handleoff (@156694)
Warning: Ignore invalid handleoff (@158728)
Warning: Ignore invalid handleoff (@160763)
Warning: Ignore invalid handleoff (@162798)
Warning: Ignore invalid handleoff (@164832)
Warning: Ignore invalid handleoff (@166866)
Warning: Ignore invalid handleoff (@168901)
Warning: Ignore invalid handleoff (@170936)
Warning: Ignore invalid handleoff (@172970)
Warning: Ignore invalid handleoff (@175004)
Warning: Ignore invalid handleoff (@177040)
Warning: Ignore invalid handleoff (@179074)
Warning: Ignore invalid handleoff (@181108)
Warning: Ignore invalid handleoff (@183142)
Warning: Ignore invalid handleoff (@185176)
Warning: Ignore invalid handleoff (@187213)
Warning: Ignore invalid handleoff (@189248)
Warning: Ignore invalid handleoff (@191282)
Warning: Ignore invalid handleoff (@193316)
Warning: Ignore invalid handleoff (@195350)
Warning: Ignore invalid handleoff (@197385)
Warning: Ignore invalid handleoff (@199420)
Warning: Ignore invalid handleoff (@201454)
Warning: Ignore invalid handleoff (@203489)
Warning: Ignore invalid handleoff (@205524)
Warning: Ignore invalid handleoff (@207559)
Warning: Ignore invalid handleoff (@209593)
Warning: Ignore invalid handleoff (@211628)
Warning: Ignore invalid handleoff (@213663)
Warning: Ignore invalid handleoff (@215697)
Warning: Ignore invalid handleoff (@217731)
Warning: Ignore invalid handleoff (@219766)
ERROR: bit_read_RC buffer overflow at 4995.0 + 1 > 4995
Warning: Ignore invalid handleoff (@221800)
Warning: Ignore invalid handleoff (@223835)
Warning: Ignore invalid handleoff (@225869)
Warning: Ignore invalid handleoff (@227904)
Warning: Ignore invalid handleoff (@229938)
Warning: Ignore invalid handleoff (@231973)
Warning: Ignore invalid handleoff (@234007)
Warning: Ignore invalid handleoff (@236041)
Warning: Ignore invalid handleoff (@238075)
Warning: Ignore invalid handleoff (@240110)
Warning: Ignore invalid handleoff (@242146)
Warning: Ignore invalid handleoff (@244183)
Warning: Ignore invalid handleoff (@246220)
ERROR: bit_read_RC buffer overflow at 4995.0 + 1 > 4995
Warning: Ignore invalid handleoff (@248254)
Warning: Ignore invalid handleoff (@250288)
Warning: Ignore invalid handleoff (@252322)
Warning: Ignore invalid handleoff (@254356)
Warning: Ignore invalid handleoff (@256394)
Warning: Ignore invalid handleoff (@258430)
Warning: Ignore invalid handleoff (@260465)
Warning: Ignore invalid handleoff (@262500)
Warning: Ignore invalid handleoff (@264535)
Warning: Ignore invalid handleoff (@266570)
Warning: Ignore invalid handleoff (@268605)
Warning: Ignore invalid handleoff (@270642)
Warning: Ignore invalid handleoff (@272679)
Warning: Ignore invalid handleoff (@274714)
Warning: Ignore invalid handleoff (@276749)
Warning: Ignore invalid handleoff (@278787)
Warning: Ignore invalid handleoff (@280822)
Warning: Ignore invalid handleoff (@282857)
Warning: Ignore invalid handleoff (@284892)
Warning: Ignore invalid handleoff (@286928)
Warning: Unstable Class object 559 MATERIAL (0x400) 112842/0
Warning: Unstable Class object 559 MATERIAL (0x400) 112843/0
Warning: Unstable Class object 559 MATERIAL (0x400) 112844/0
Warning: Unstable Class object 561 TABLESTYLE (0xfff) 112863/0
Warning: Ignore invalid handleoff (@288963)
ERROR: Invalid .files x 3709541268

Warning: Skip empty section 0 AcDb:Template
Writing DXF file /Users/weiken/Downloads/test1.dxf
ERROR: Invalid SAB
Warning: Empty REGION.history_id

ERROR: Invalid SAB
Warning: Empty REGION.history_id

ERROR: Invalid SAB
Warning: Empty REGION.history_id

Warning: Unstable Class object 559 MATERIAL (0x400) 112842/74D36
Warning: Unstable Class object 559 MATERIAL (0x400) 112843/74D37
Warning: Unstable Class object 559 MATERIAL (0x400) 112844/74D38
Warning: Unstable Class object 561 TABLESTYLE (0xfff) 112863/74D4B

origin dwg file open with AutoCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/f582e45d-836e-46a8-8ea8-19e0cf8eb51c)

converted dxf file open with LibreCAD:
![image](https://github.com/LibreDWG/libredwg/assets/42831401/924e74ea-1b25-43f6-a661-a4fd55e20bf7)

### attachment
[samples.tar.gz](https://github.com/LibreDWG/libredwg/files/11720823/samples.tar.gz)

--- end body ---
